Re: [PHP] upload file problem



Maybe check the return value of the function:
http://us3.php.net/manual/en/function.move-uploaded-file.php

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Jignesh Thummar wrote:
I'm trying to upload the file. It's showing me successfully uploaded.
But it's not able to move from temp directory to my defined directory

my code:

if (is_uploaded_file($_FILES['myfile']['tmp_name'])) {
move_uploaded_file($_FILES['myfile']['tmp_name'], $myfilename);
echo "File ". $_FILES['myfile']['name'] ." uploaded successfully.\n";
} else {
echo "File uploading error";
}

Thanks in advance.

-Jignesh


.



Relevant Pages

  • Re: [PHP] upload file problem
    ... Jignesh Thummar wrote: ... But it's not able to move from temp directory to my defined directory ... echo "File uploading error"; ...
    (php.general)
  • Re: [PHP] upload file problem
    ... On Thu, Jul 31, 2008 at 10:18 AM, Jignesh Thummar ... But it's not able to move from temp directory to my defined directory ... Is the directory you're moving to writable by your web server? ... try making a separate script that tries ...
    (php.general)
  • Re: [PHP] upload file problem
    ... But it's not able to move from temp directory to my defined directory ... echo "File uploading error"; ... try making a separate script that tries ...
    (php.general)
  • Re: [PHP] upload file problem
    ... On Thu, Jul 31, 2008 at 10:18 AM, Jignesh Thummar ... But it's not able to move from temp directory to my defined directory ... If it is passing the if) condition, echo out ... Dedicated servers, VPS, and hosting from $2.50/mo. ...
    (php.general)