move_uploaded_file returns False
Posted: Mon Jul 31, 2006 10:58 am
Huy guys,
I've got a strange thing going on. I'm trying to upload a file to a directory called "uploads". When the code is installed on my first server, everything is working fine. On the second test server I've got an error. Both servers are windows NT/XP servers.
Here's the code:
This is the output of print_r($_FILES);:
I'm guessing the problem lies in the temp file. Where the hell is ".\" coming from?
Anyone?
TIA
I've got a strange thing going on. I'm trying to upload a file to a directory called "uploads". When the code is installed on my first server, everything is working fine. On the second test server I've got an error. Both servers are windows NT/XP servers.
Here's the code:
Code: Select all
$target_path = "../../images/uploads/";
$uploadfile = $target_path . basename($_FILES['uploadedfile']['name']);
if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $uploadfile))
echo "everything ok"
else echo "error" ;Code: Select all
Array
(
[uploadedfile] => Array
(
[name] => testfile.jpg
[type] => image/pjpeg
[b][tmp_name] => .\php16.tmp[/b]
[error] => 0
[size] => 20752
)
)Anyone?
TIA