this worked fine for one file at a time, then i tried to name the form elements like an array,
so i could upload four files at once, and it all went to crud. Any help?
thanks!
<td><form action="uploadReportAction.php" method="post" enctype="multipart/form-data" name="form1">
<tr>
<td class="formContent"><input name="form[uploads][]" type="file" size="30"></td>
<td class="formContent"><input name="form[uploads][]" type="file" size="30"></td>
</tr>
<tr>
<td class="formContent"><input name="form[uploads][]" type="file" size="30"></td>
<td class="formContent"><input name="form[uploads][]" type="file" size="30"></td>
</tr>
<?php
$file_dir = "/home/httpd/vhosts/babysteps.tv/httpdocs/counterpoint/uploads";
$file_url = "http://babysteps.tv/counterpoint/uploads";
foreach( $_FILES as $file_name => $file_array ) {
print "path: ".$file_array['tmp_name']."<br>\n";
print "name: ".$file_array['name']."<br>\n";
print "type: ".$file_array['type']."<br>\n";
print "size ".$file_array['size']."<br>\n";
move_uploaded_file( $file_array['tmp_name'], $file_dir.'/'.$file_array['name'] )
or die ("Couldn't Copy");
}
?>
I have all those prints in there just to double check at this point. They'll come out in the final version...
All of them just printed the word "Array".