Hello All,
I have a multi-uploader javascript that dynamically creates file upload fields much in the same way that GMail does. Each file field is named incrementally based on a counter, with the resulting name being "file_countervalue".
My problem arises in the script that handles the form, in that I can't figure out how to dynamically define the name in the $_FILES superglobal. I.E. my simple test script reads as follows:
$counter = 1;
if (isset($_POST['Submit'])) {
while ($counter < 100) {
$filename = 'file_'.$counter;
if (is_uploaded_file ($_FILES[$filename])) {
echo 'yes '.$counter.' --- ';
}
$counter++;
}
}
But this fails to return anything. (**NOTE: I chose to employ a counter and cycle through 100 results because my multi-uploader also allows the user to remove file-upload fields, so there is no guarantee that the fields will be contiguously numbered)
You can see my multi-uploader in action here.
Thanks for any and all advice!
~Jordan