Re: [PHP] upload file problem



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";
}


What does $myfilename resolve to? It should include the complete path from server root (not DOCUMENT_ROOT).

Try:

echo "File uploading error: ${myfilename}";
.



Relevant Pages

  • Re: Help-
    ... Anyway to get around the Access Denied in Vista and the file is in use by another process? ... @echo off ... I would like a script that I can click on and have it delete all the files in the temp directory. ...
    (microsoft.public.windows.server.scripting)
  • Re: Check current dir without whole path?
    ... echo current directory is a temp directory ... Sending unsolicited commercial e-mail to this account incurs a fee of ...
    (comp.unix.shell)
  • 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)
  • Re: [PHP] upload file problem
    ... onShore Networks ... Jignesh Thummar wrote: ... But it's not able to move from temp directory to my defined directory ... echo "File uploading error"; ...
    (php.general)