Have a nice day,

i am working on image gallery, i want to create a php script that allow user to select multiple files from any folder of his computer and then upload it to server, just like flickr or orkut, but i have no idea how it can be done.

please anybody help in this regard.

Thanks

Have a nice day,

i am working on image gallery, i want to create a php script that allow user to select multiple files from any folder of his computer and then upload it to server, just like flickr or orkut, but i have no idea how it can be done.

please anybody help in this regard.

Thanks

In order to upload multiple files, you need multiple file upload fields.
The file upload on flickr, orkut would use JavaScript to create the multiple upload files in the upload form.

So as you clicked the "add file" button, JavaScript generated a new <input type="file"> field and appended it to the <form>.

Basically, it is more of a JavaScript question then PHP.

To handle file uploads in PHP see:

http://www.php.net/features.file-upload

If you want upload multiple files and receive them as an Array, then name your files like:

<input type="file" name="files[]" />

see: http://www.php.net/manual/en/faq.html.php#faq.html.arrays

This is also in "Example 3" on the PHP file uploads docs. http://www.php.net/features.file-upload

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.