I have done this before in putting the usefile into an array. for some reason now, I am having a problem.... It works for two of the items being uploaded and the balance I get this error :
"Warning: Unable to open 'none' for reading: No such file or directory in path/docs_uploader.php on line 12
Warning: Unlink failed (No such file or directory) in path//docs_uploader.php on line 13
here is the code...
<?
if ($userfile !="none") {
for ($m =0; $m < count($userfile); $m++) {
echo $m , "<br>";
copy($userfile[$m],"/home/dots/projects/www.willcap.com/uploads/$userfile_name[$m]");
unlink($userfile[$m]);
}
}
<center><form action=<?php echo $PHP_SELF; ?> enctype=multipart/form-data method=post>
<input type=hidden value=<? echo $category ?> name=category>
<table>
<tr>
<td width="30%">html to upload</td>
<td> <INPUT NAME="userfile[]" TYPE="file">
</td>
</tr>
<tr>
<td width="30%">pdf or doc to upload</td>
<td> <INPUT NAME="userfile[]" TYPE="file">
</td>
</tr>
<?
if ($category == 2) {
for ($i = 0; $i < 5; $i++) {
?>
<tr>
<td>Image # <? echo $i+1; ?></td>
<td> <INPUT NAME="userfile[]" TYPE="file">
</td></tr>
<?
}
}
?>
</td></table>
Hmm. It works when I upload 2 records but, when I do more I get this error..
Ray