coderex
coderex

Reputation: 27885

Is folder uploading possible in PHP?

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

Upvotes: 1

Views: 1405

Answers (3)

Jesse Dorsey
Jesse Dorsey

Reputation: 540

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.

Upvotes: 7

Alistair Evans
Alistair Evans

Reputation: 36513

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.

Upvotes: 0

Zanoni
Zanoni

Reputation: 31028

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/

Upvotes: 4

Related Questions