| | |
Multiple files Upload plz HelP
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2008
Posts: 43
Reputation:
Solved Threads: 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['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
<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
If you want information about multiple files uploading refer this link
http://www.phpeasystep.com/workshopview.php?id=2
http://www.phpeasystep.com/workshopview.php?id=2
![]() |
Other Threads in the PHP Forum
- Previous Thread: Multiple languages site?
- Next Thread: Generating Fields On the Fly
| Thread Tools | Search this Thread |
5.2.10 action apache api array beginner beneath binary broken cakephp checkbox class classes cms code cron curl database date destroy display dynamic echo echo$_get[x]changingitintovariable... email encode error fcc file files folder form forms function functions google header howtowriteathesis href htaccess html image images include insert ip javascript joomla limit link local login mail memberships menu mlm mod_rewrite multiple multipletables mysql mysqlquery neutrality oop open passwords paypal pdf php provider query radio random record remote rss script search server sessions sockets source space sql strip_tags syntax system table template thesishelp tutorial update upload url validator variable video voteup web window.onbeforeunload=closeme; youtube





