class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
I've been searching this forum and site for an hour. There are no clear cut to the point examples of how to upload multiple files with one submission..... With a GREAT class like this I don't understand how that wouldn't be something very easily done. I just want to upload 4 or 5 images at once. Can you help with actual examples of both the form and upload.php?Reply
Look in the FAQ, the question What about multiple uploads?.
Basically, first have the form and your upload code working for one image. For instance, the name of your upload field (INPUT type file) will be my_field.
Then, duplicate your upload field, keeping the same name for each copy, but adding [] to the name. So you will have 5 fields named my_field[].
Then, use the code as is the FAQ. That code first reformats the $_FILES array, into an array of elements that you can feed to the upload class one by one. Create your loop, and apply the same settings for each file if you wish to.
I don't have the time to write a proper tutorial now, but I will add it to my to-do list...Reply
Thanks I figured it was something in the submit form. I'd seen the code in the faq but (obviously) it wasn't working because i just duplicated all the fields as "my_field" thinking $_FILES would know to put them in an array.
Basically, first have the form and your upload code working for one image. For instance, the name of your upload field (INPUT type file) will be my_field.
Then, duplicate your upload field, keeping the same name for each copy, but adding [] to the name. So you will have 5 fields named my_field[].
Then, use the code as is the FAQ. That code first reformats the $_FILES array, into an array of elements that you can feed to the upload class one by one. Create your loop, and apply the same settings for each file if you wish to.
I don't have the time to write a proper tutorial now, but I will add it to my to-do list...
I'll try this now.
I have one more question I'll start a new thread for.