move_uploaded_file on localhost



Hi,
The code below is working - it returns the 'Received' message, however
I cannot find the uploaded file in the destination folder, or anywhere
else (other than source directory). I'm running PHP 5.2.5 on my PC
running Apache 2.0. Thanks.

<?php
$uploadDir = "/uploads";
$temp = $uploadDir;

if(is_uploaded_file($_FILES['upfile']['tmp_name']))
{
}
else
{
echo "the file was not uploaded correctly, try again";
exit(0);
}

if(move_uploaded_file($_FILES["upfile"]["tmp_name"], $uploadDir ))
print "Received {$_FILES['upfile']['name']} - its size is
{$_FILES['upfile']['size']}";
else
{
echo "error moving file from ".$_FILES["upfile"]["tmp_name"]." to
$uploadDir";
exit(0);
}
?>
.



Relevant Pages

  • Re: move_uploaded_file on localhost
    ... Piotr wrote: ... I cannot find the uploaded file in the destination folder, ... I'm running PHP 5.2.5 on my PC ...
    (comp.lang.php)
  • Re: move_uploaded_file on localhost
    ... I cannot find the uploaded file in the destination folder, ... else (other than source directory). ... I'm running PHP 5.2.5 on my PC ...
    (comp.lang.php)
  • Re: move_uploaded_file on localhost
    ... I cannot find the uploaded file in the destination folder, ... else (other than source directory). ... I'm running PHP 5.2.5 on my PC ...
    (comp.lang.php)
  • Re: File Upload Craziness
    ... approx. ... You can run my little sample script here:http://www.paramountlists.com/v3/ftp/cff_test2.php ... echo "The uploaded file was only partially uploaded."; ...
    (comp.lang.php)