Search code examples
phpunlink

php unlink() not found


When I call unlink like so:
unlink($_FILES['upload_file']['tmp_name']);

I get the following error message:
unlink(): No such file or directory in /home/user/public_html/file.php on line 18, referer: http://localhost/file.php

I know I'm not exactly proficient in the language, but I checked the manual at http://www.php.net/manual/en/function.unlink.php and I seem to be using it right.


Solution

  • Seems that $_FILES['upload_file']['tmp_name'] does not exist. Try to print it to check is it correct path.

    Anyway, You don't need delete tmp files, they will be deleted automatically.