PHP upload entire folder of files?
Posted: Thu Jul 23, 2009 9:26 am
So I want to be able to have my users upload entire folders of images to the server.....
I know I cant create an upload form and have them just select an entire folder, but I have a few ideas about how to accomplish this task and I want some input..
Ideas:
1.) Have the user zip the folder, have them upload it through the form, and then have PHP unzip the folder and put it where it needs to go
2.) I'm not sure if this will work at all.... Can I use java script to somehow scan the folder than the user has selected on their computer, have it load all of the file names into an array, then have PHP create a new folder on my server and upload the one by one all the the files in the array on its own?
Idea 1 seems easy as I already have the zip library running in another part of my code, but requires more work on part of the user, which I want to avoid. Anyone have input of other ideas that are easy to implement?
I know I cant create an upload form and have them just select an entire folder, but I have a few ideas about how to accomplish this task and I want some input..
Ideas:
1.) Have the user zip the folder, have them upload it through the form, and then have PHP unzip the folder and put it where it needs to go
2.) I'm not sure if this will work at all.... Can I use java script to somehow scan the folder than the user has selected on their computer, have it load all of the file names into an array, then have PHP create a new folder on my server and upload the one by one all the the files in the array on its own?
Idea 1 seems easy as I already have the zip library running in another part of my code, but requires more work on part of the user, which I want to avoid. Anyone have input of other ideas that are easy to implement?