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
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.