Reply to Re: Multiple selection / multiple upload

Re: Multiple selection / multiple upload new!
by colin, 14 years, 1 month ago
The foreach() loops are to be used only if you have multiple upload fields.

In your case, you have only one field my_field. You can instanciate the class directly without looping through the $_FILES array.

If you want multiple upload fields, you need to have several fields in your form, and then you will have to loop through $_FILES as in the FAQ. To have several fields, you would need to have something like this in your form:
<input type="file" size="32" name="my_field[]" value="" />
<input type="file" size="32" name="my_field[]" value="" />
<input type="file" size="32" name="my_field[]" value="" />
Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important