views:

750

answers:

5

Hi, I wish my users could select a directory from their PC and upload all files from this directory, so they could upload whole album(directory) instead of uploading every single file separately. I would like to ask you if this is somehow possible using PHP or JavaScript and without using any framework. thank you

+1  A: 

It would probably make more sense for them to upload a .zip containing multiple images - which is possible in PHP.

karim79
+4  A: 

First of all, PHP can't do anything to the user's local computer. Since it never runs there (unless the user's computer is the server also).

JavaScript runs on the user's local computer but isn't setup to handle things like this.

Java and Flash runs on the user's computer and can be setup to do exactly this.

Look at SWFUpload. I highly recommend it.

And if you want Java, check out RadUpload. The lite edition is free.

A thing to note, what these Flash and Java solutions both do is accept a file selection from the user and then send that to a PHP script which does the actual uploading.

Ólafur Waage
A: 

I do not think it is possible as you describe it. Create a small utility which they can run on their PC that will do the job. Also check out how Facebook upload image works. They upload dozens of images at the same time.

Ryan Oberoi
A: 

Not possible using purely php/javascript. However, take a look at http://www.element-it.com/JavaPowUpload.aspx, it is a java-based file uploader that allows you to completely hide the interface, and, if you wish, power the whole interface via javascript. However, it is not free, perhaps not suitable for a personal project.

Kazar
A: 

This may not meet your requirement of Javascript, but if you wish you could build your uploader object as an activex object and use CURL to actually perform the upload or do it as a Java applet.

I had built a Java applet based uploader for a client and I found resources on line and used that as my base for building the uploader.

SWFUpload, as mentioned in one of the answers you received is a good one.