Hello!
I posted here a while ago regarding a problem with the unlink() function. I've been trying to fix it for weeks and can't seem to do it! I've been working with the code, and I've been trying to simply delete a photo based on a filename from a database. Instead of going into the code right now, I'm mainly just concerned with one thing:
What does the following error mean:
Warning: unlink(/home/owstopit/lizziewrightphotography.com/css/images/photos/wallsanddoors/) [function.unlink]: Is a directory in /home/owstopit/lizziewrightphotography.com/private/delete_photo_wallsanddoors.php on line 14
The first filepath mentioned in the error is the path to the folder containing the image I want to delete. The second path is the location of the script that's trying to delete the file. What does this error mean?!
Unlink() error
Moderator: General Moderators
Re: Unlink() error
A suggestion in another forum pointed to the variable for the filename from the database being empty.
http://forum.ragezone.com/f144/php-func ... nk-425744/
http://forum.ragezone.com/f144/php-func ... nk-425744/
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Unlink() error
Indeed, you are passing a directory path instead of the filename.. indicative of you misusing your variables. It will obviously complain if you are trying to delete a directory with files in it.
Try posting the relevant code, and try adding some debugging to figure out where your filename assignment (the file you want to delete) is not assigned correctly.
Try posting the relevant code, and try adding some debugging to figure out where your filename assignment (the file you want to delete) is not assigned correctly.