uploading a whole folder
Posted: Fri Jul 15, 2005 12:09 am
I have a form where a user could upload a picture, then another one, then another one, a single picture at a time.
However, one of my clients is going to be uploading up to 100 pictures at a time.
Even with a form for selecting 100 pictures, this would be tedious.
So I'm going to attempt to make a script to upload a whole folder at a time.
My logic:
1.) File upload form where the browse button selects folders, not files
2.) Pick out all files ending in .JPG
3.) Loop through and upload
Sounds good.
However, is there an HTML form that selects directories (I've never ran across one while coding)?
Picking out only .JPG files, should be easy.
Looping through them, brings me to a question.. I can't use readdir() can I? It seems that readdir is for an already existing directory on the server. How would I go about looping through the files?
Is this beyond the scopes of PHP?
However, one of my clients is going to be uploading up to 100 pictures at a time.
Even with a form for selecting 100 pictures, this would be tedious.
So I'm going to attempt to make a script to upload a whole folder at a time.
My logic:
1.) File upload form where the browse button selects folders, not files
2.) Pick out all files ending in .JPG
3.) Loop through and upload
Sounds good.
However, is there an HTML form that selects directories (I've never ran across one while coding)?
Picking out only .JPG files, should be easy.
Looping through them, brings me to a question.. I can't use readdir() can I? It seems that readdir is for an already existing directory on the server. How would I go about looping through the files?
Is this beyond the scopes of PHP?