0

i really need help in my script for uploading multiple files ...the script looks very fine and i cant see anything wrong in there:

<td>Gallery</td>
<?  for($i=1;$i<=4;$i++)
{
echo"<input type='hidden' name='MAX_FILE_SIZE' value='1000000'>";
echo"<td><input type='file' name='userfile[]' class='input'></td>";
}
?>


while(list($key,$value)=each($_FILES))
{   if ($_FILES >0)
{
echo 'Problem: ';
switch($_FILES )
{
case 1: echo 'File exceeded upload_max_filesize'; break;
case 2: echo 'File exceeded max_file_size'; break;
case 3: echo 'File only partially uploaded'; break;
case 4: echo 'No file uploaded'; break;
case 6: echo 'Missing a temporary folder';break;
case 7: echo 'Failed to write file to disk';break;
case 8: echo 'File upload stopped by extension';break;
}
exit;
}
if($_FILES!='image/gif' &&$_FILES!='image/pjpeg'&&
$_FILES!='image/png')
{ echo " Sorry, you may only upload jpg, gif or png ";
exit;
}



$upfile = 'villagallery/'.$_FILES ;
if (is_uploaded_file($_FILES))
{
move_uploaded_file($_FILES, $upfile) ;
$success=1;
}

it keeps telling me : Problem: (without specifying the error) although i upload correct files with no errors ...............plz help

Edited by happygeek: fixed formatting

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by srilakshmitr7
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.