tags:

views:

249

answers:

3

Is there any way to upload an entire folder using PHP?

+4  A: 

That's not a limitation of PHP, but of the browsers themselves. They don't allow you to select a "folder" to upload. You can only do a file; one file per input tag.

Your best bet is to zip a folder, upload it and use PHP to unzip it on the local file system.

or

You could use (Java Applet): http://jupload.biz/

or

(Flash) http://swfupload.org/

Zanoni
I suppose a partial solution would be SWFUpload, since it allows multiple file selection. Files are uploaded individually too, so the constraint on post max size is on a per-file basis.
Wayne Khan
A: 

No, not only php, you would require an activex control (IE only) or java applet.

Take a look at http://sourceforge.net/projects/jupload/, it is a java applet intended to allow multiple file/folder uploading.

Kazar
+6  A: 

No. Its not a limitation of PHP, but a limitation of the browser itself. There is no way to select a folder for upload (and pass the data through).

You could however upload an archive, and then use php to unzip it.

Noctrine