943,598 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 695
  • PHP RSS
Oct 7th, 2008
0

Multiple files Upload plz HelP

Expand Post »
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['userfile']['name']))
{ if ($_FILES['userfile'] ['error']>0)
{
echo 'Problem: ';
switch($_FILES['userfile'] ['error'])
{
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['userfile']['type']!='image/gif' &&$_FILES['userfile']['type']!='image/pjpeg'&&
$_FILES['userfile']['type']!='image/png')
{ echo " Sorry, you may only upload jpg, gif or png ";
exit;
}


$upfile = 'villagallery/'.$_FILES['userfile']['name'] ;
if (is_uploaded_file($_FILES['userfile']['tmp_name']))
{
move_uploaded_file($_FILES['userfile']['tmp_name'], $upfile) ;
$success=1;
}

it keeps telling me : Problem: (without specifying the error) although i upload correct files with no errors ...............plz help
Reputation Points: 10
Solved Threads: 0
Light Poster
yasmena is offline Offline
45 posts
since May 2008
Oct 8th, 2008
0

Re: Multiple files Upload plz HelP

If you want information about multiple files uploading refer this link

http://www.phpeasystep.com/workshopview.php?id=2
Reputation Points: 16
Solved Threads: 2
Light Poster
srilakshmitr7 is offline Offline
32 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Multiple languages site?
Next Thread in PHP Forum Timeline: Generating Fields On the Fly





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC