Jump to content

move_uploaded_file doesn't work


ayok

Recommended Posts

Hi,

 

I have a problem with my upload script, the move_uploaded_file doesn't work. It works on other server, but in this server, where I work on now, it's just return false with no error message.

 

Could anybody tell me what's wrong?

 

thanks,

ayok

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.