Best Way To Get Multiple Files From A User?

liunx

Guest
Hi all,<br /><br />I'm brand new to the board here. I'm designing a website for a client and recommended he switch from a Windows/IIS-based host to TCH. Now that the domain has propagated and I'm finishing up the design, I had a question for you gurus in here.<br /><br />We're having a contest, in which we ask users to submit around 10 photos to us (in JPEG format). My question is, what's the best way to get those photos? Asking them to e-mail us one or two photos would be okay, but we're asking for at least 10 and I don't want that kind of traffic going through e-mail. My question is, should I use some sort of PHP script that provdies a form on the site, where people can select 10 files from their computer? Or should I somehow give them access via a special FTP account?<br /><br />I am inclined to think that a PHP script would be better and more secure, but all of the free scripts I've seen only handle uploading one file at a time. I'd prefer to put somewhere on the order of 10 file fields on the same page and let them upload the whole lot. Is there a problem with timeouts/length of transaction in that case? And if so, can anyone advise me as to how to handle it?<br /><br />A disclaimer: While I'm good with HTML/CSS and graphic tools, I'm basically a PHP newbie who has dabbled only in JavaScript and the ancient art of GW-BASIC, so I'm a designer first and a programmer second. Don't need much hand-holding because I learn quick, though, so feel free to fire away. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /><br /><br />BTW: From what I can see, TCH is a really great host. I think I'm going to open two new accounts here next month for my own personal websites. I ran through the system status pages on all of your servers and they'll all running with only moderate load and very little disk swap usage. That's so nice to see. The server I'm hosted on right now is at 100% / 100% all the time and it makes me nervous. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/ohmy.gif" style="vertical-align:middle" emoid=":eek:" border="0" alt="ohmy.gif" /> <br /><br />Anyway, thanks in advance!<!--content-->
I've done some very extensive PHP programming but none of it has ventured into file uploading... yet.<br /><br />The way that I would attack the problem would be to find a free PHP script that you like, and then do some surgery on the script so that it tries to upload several files.<br /><br />I know that doesn't give you a whole lot of detail... but it really depends on the code in the script.<br /><br />I'd take a look at the url where the file upload goes on, open it up in an editor, see where it's posting the data. You should be able to add more fields to the form without too much effort. Be careful what you are naming the fields. <br /><br />Then open up the script that recieves the post data and see if you can follow the logic (it's not very hard) and just add in the extra variables for your other files.<br /><br />Also, I'd attempt to add one extra field at first, so your development time is shorter with the script and you can start testing it asap. Once you get two working, it's just a matter of adding more until you either reach ten or the threshold of what is allowed.<br /><br />I have a feeling you'll be able to do it... just don't know for sure.<br /><br />Sorry I can't be more detailed, but I thought providing you with a basic methodology would help a little.<!--content-->
Thanks <b>surefire</b>! Thumbs Up <br /><br />No worries about not being more specific; you couldn't really unless you've done something like this before. Sounds like a good approach to take though. The file upload is not really essential to the first release of the site, however, so perhaps I'll defer it for a little bit. But if I do manage to make something like that work, I can share the mods I made to the script. Someone else might find it useful. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
 
Top