Page 1 of 1

uploading a whole folder

Posted: Fri Jul 15, 2005 12:09 am
by s.dot
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?

Posted: Fri Jul 15, 2005 12:30 am
by Burrito
can't be done, php is server, files are on the client.

I posted about 6 months ago almost this very question, using HTML and http as the protocol, you're stuck doing only one at a time unless you write some kind of java applet, or flash, or activeX control they can install on their machine that would give you access to their file system. Can you have them just ftp the files/folder to the server, then do your scripting on the folder once it's there?

Posted: Fri Jul 15, 2005 12:58 am
by s.dot
SCORE! Free lunch for me.

Unless you count the 8O in your sig ;/

Posted: Fri Jul 15, 2005 1:00 am
by Burrito
lol, nice work!

8O

edit: pm me your paypal details :oops:

Posted: Fri Jul 15, 2005 1:04 am
by s.dot
My Paypal is... inacessable :))

I haven't logged in in forever

I accept personal check or MO

Posted: Fri Jul 15, 2005 1:08 am
by Burrito
well then I guess you're foobar'ed
:wink:

Posted: Fri Jul 15, 2005 1:16 am
by s.dot
SCORE!
Free lunch AGAIN!?

Edit: Is there a rule for off-topic-ness?

Posted: Fri Jul 15, 2005 1:19 am
by Burrito
neg, it's done by topic, and I already put it in your topic.

/me thinks this may have been a bad idea.

unfrozen caveman lawer might return sooner than later...

edit:
Edit: Is there a rule for off-topic-ness?
not sure, but we've most definitely violated it if there is...back to "real" discussions....