Page 1 of 1

Unlink() error

Posted: Tue Dec 16, 2008 8:14 am
by Hendeca
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?!

Re: Unlink() error

Posted: Tue Dec 16, 2008 11:32 am
by ironmaan
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/

Re: Unlink() error

Posted: Tue Dec 16, 2008 12:00 pm
by John Cartwright
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.