singedpiper
01-04-2006, 11:29 PM
I am attempting to use portablewebap to write an interface for a laptop based picture frame... the following code was supposed to upload an image... however, I'm getting the error:
Warning: move_uploaded_file(PHP\uploadtemp\phpAF3.tmp) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\Documents and Settings\Charlie\Desktop\no hassle php\PortableWebAp3.1\PortableWebAp3.1\Program\www\localhost\music\upload.php on line 103
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'PHP\uploadtemp\phpAF3.tmp' to 'files/test2.txt' in C:\Documents and Settings\Charlie\Desktop\no hassle php\PortableWebAp3.1\PortableWebAp3.1\Program\www\localhost\music\upload.php on line 103
error moving file from PHP\uploadtemp\phpAF3.tmp to files/test2.txt
here's the pertinant code:
$uploadDir = "files/";
$i = 1;
$temp = $uploadDir;
$simplename = basename( $_FILES['file']['name']);
while(file_exists($uploadDir.$simplename))
{
$uploadDir = $temp.$i;
$i++;
}
$uploadFile = $uploadDir.$simplename;
if(is_uploaded_file($_FILES['file']['tmp_name']))
{
}
else
{
echo "the file was not uploaded correctly, try again";
exit(0);
}
if(move_uploaded_file($_FILES["file"]["tmp_name"], $uploadFile))
echo "sucessful upload to $uploadFile";
else
{
echo "error moving file from ".$_FILES["file"]["tmp_name"]." to $uploadFile";
exit(0);
}
Is the error with my code, or the server? help? :confused:
Warning: move_uploaded_file(PHP\uploadtemp\phpAF3.tmp) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\Documents and Settings\Charlie\Desktop\no hassle php\PortableWebAp3.1\PortableWebAp3.1\Program\www\localhost\music\upload.php on line 103
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'PHP\uploadtemp\phpAF3.tmp' to 'files/test2.txt' in C:\Documents and Settings\Charlie\Desktop\no hassle php\PortableWebAp3.1\PortableWebAp3.1\Program\www\localhost\music\upload.php on line 103
error moving file from PHP\uploadtemp\phpAF3.tmp to files/test2.txt
here's the pertinant code:
$uploadDir = "files/";
$i = 1;
$temp = $uploadDir;
$simplename = basename( $_FILES['file']['name']);
while(file_exists($uploadDir.$simplename))
{
$uploadDir = $temp.$i;
$i++;
}
$uploadFile = $uploadDir.$simplename;
if(is_uploaded_file($_FILES['file']['tmp_name']))
{
}
else
{
echo "the file was not uploaded correctly, try again";
exit(0);
}
if(move_uploaded_file($_FILES["file"]["tmp_name"], $uploadFile))
echo "sucessful upload to $uploadFile";
else
{
echo "error moving file from ".$_FILES["file"]["tmp_name"]." to $uploadFile";
exit(0);
}
Is the error with my code, or the server? help? :confused: