Woodburn2006 Posted May 29, 2007 Share Posted May 29, 2007 i tried to use the unlink function to delete an image but i get an error message whenever i try to do it. Warning: unlink() [function.unlink]: http does not allow unlinking in /home/ppages/public_html/doc/admincontrol/models/forhire/edit.php on line 15 anyone have any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/53409-unlink-error/ Share on other sites More sharing options...
Wildbug Posted May 29, 2007 Share Posted May 29, 2007 unlink isn't supported in the http wrapper. See this link. Quote Link to comment https://forums.phpfreaks.com/topic/53409-unlink-error/#findComment-263889 Share on other sites More sharing options...
Woodburn2006 Posted May 29, 2007 Author Share Posted May 29, 2007 so is there no way i can do this? Quote Link to comment https://forums.phpfreaks.com/topic/53409-unlink-error/#findComment-263903 Share on other sites More sharing options...
Wildbug Posted May 29, 2007 Share Posted May 29, 2007 I didn't say that. You just can't use an http wrapper to do so. You can use an ftp:// wrapper or, if the file is on localhost, the filesystem. Quote Link to comment https://forums.phpfreaks.com/topic/53409-unlink-error/#findComment-263907 Share on other sites More sharing options...
Woodburn2006 Posted May 29, 2007 Author Share Posted May 29, 2007 ok cool, im quite new to all this so not too sure how i would go about it. the way i am doing it is that i am building a control panel for the user of the site and they can change like a profile image and when they replace their profile image it deletes the old one from the server. i can get it to do everything except delete the old one Quote Link to comment https://forums.phpfreaks.com/topic/53409-unlink-error/#findComment-263914 Share on other sites More sharing options...
Wildbug Posted May 29, 2007 Share Posted May 29, 2007 Well, don't use unlink("http://...."), just use the location of the file as you would locally. unlink("/var/www/users/fred/image.jpg") (or whatever) Quote Link to comment https://forums.phpfreaks.com/topic/53409-unlink-error/#findComment-263916 Share on other sites More sharing options...
Woodburn2006 Posted May 29, 2007 Author Share Posted May 29, 2007 ah ok thanks, i can see where i have gone wrong now. thanks alot Quote Link to comment https://forums.phpfreaks.com/topic/53409-unlink-error/#findComment-263923 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.