Jump to content

move_uploaded_file doesn't work


ayok

Recommended Posts

Hi thanks,

 

Here is the code for the upload page:

<?
echo "<table width=500 align=center>";
echo"<form enctype='multipart/form-data' action='newpics.php' method='POST'>";
for($i=0;$i<5;$i++){
$no=$i+1;
echo "<tr><td>Foto $no:</td><td> <input type='FILE' name='fupload[]'></td></tr>";
}
echo "<tr><td><INPUT TYPE=submit value=Uplot></td></tr>";
echo "</form></table>";
}
?>

 

And this is newpics.php

<?
$fupload = $_FILES['fupload']['tmp_name'];
$fupload_name = $_FILES['fupload']['name'];
$fupload_type = $_FILES['fupload']['type'];
$jml_file=count($fupload);
$i=0;
while($i < $jml_file){
$direktori_file = "../../writable/products/$fupload_name[$i]";
move_uploaded_file($fupload[$i],"$direktori_file"); 
$i++;
}
header("location:index.php");
?>

 

move_uploaded_file doesn't work. It just goes to index.php with no uploaded image.

But, this script are working on my localhost.

 

ayok

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.