Jump to content

unlink not workin error message


stefpretty

Recommended Posts

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] Warning: unlink(photo/15.jpg): No such file or directory in /home/fsuk/public_html/bla/delphoto.php on line 9[/quote] thts the error message am i using the ulin incorrectly? heres the coe of line 9:
[code]   unlink('photo/'.$_SESSION['photo']);[/code]

it also does it when uploading with the upload form as befor eit uploads it deletes the old pic frst so im thinkin its my syntax of unlink..... heres error message [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
Warning: unlink(http://fsuk.t1hosting.co.uk/bla/photos/15.jpg): No such file or directory in /home/fsuk/public_html/bla/changephotoparse.php on line 28[/quote] and code of line 28

[code]unlink('http://fsuk.t1hosting.co.uk/bla/photos/'.$_SESSION['photo']);[/code]
thanks please get back to me asap

also my permissions are fine
Link to comment
https://forums.phpfreaks.com/topic/6773-unlink-not-workin-error-message/
Share on other sites

[code]if (file_exists('photo/'.$_SESSION['photo'])) {
   unlink('photo/'.$_SESSION['photo']) or die("Unlink problem!");
  echo "File removed successfully.";
} else {
  echo "Someone beat me to it.  The file does not exist.";
}[/code]

This might help. Also you can't unlink a file on a remote server. You must use relative paths, so no unlink('http://myserver.com/filename').

Check Appendix M on the [a href=\"http://www.php.net\" target=\"_blank\"]http://www.php.net[/a] site for more information.

Let us know if you have any further problems.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.