Forum Moderators: coopster

Message Too Old, No Replies

Uploading Multiple Files

a beginner stuck

         

dreamcatcher

8:49 pm on Sep 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Guys,

I`m trying to re-write this uploader script that I have so that visitors can upload multiple files. I seem to be having some problems. I have created a form, which uses a while loop to show however many upload fields are specified in a config file.

For each field I am using:

<input type="hidden" name="MAX_FILE_SIZE" value="$max_file">
<input type="file" size="30" name="userfile[]">

$max_file is set to "100000"

Can someone tell me the syntax for uploading all the files, checking that each one is within the specified file size? I`m assuming its a foreach loop, but I`ve looked on some of the other PHP sites and can`t seem to get my head round it.

Thanks for the help.

:)

jatar_k

9:23 pm on Sep 11, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



take a look at our good old Image Uploader
Bag-O-Tricks for PHP II [webmasterworld.com] msg #29

that is exactly what it does

dreamcatcher

9:42 pm on Sep 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks jatar_k, very interesting. I`m not using a database , but can I assume some of the syntax is the same?

jatar_k

10:06 pm on Sep 11, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



sorry I wasn't really thinking did you look at this?
Handling file uploads [ca.php.net]

dreamcatcher

5:50 am on Sep 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yeah, I did take a look at the PHP.net site, but when I tried some of the coding recommended, it didn`t seem to work. Its something I`m doing wrong when I put the syntax in a function I think, so I`ll have a play around and see what I can come up with. If I have no joy, I`ll come back and post my code.

:)