Forum Moderators: coopster
Im having trouble getting this unlink code to work :(
Can anyone please help?
[php]
// Delete the pictures associated with the product
$file = "$picture";
if (!file_exists("../../../product-images/$file")) {
print "Error: cant find the picture";
exit;
}
//if we've gotten to this point, we know the file does exist
if (!unlink($file)) // attempt to delete the file
{
echo ("Error deleting $file");
exit;
}else{
echo ("The image has been deleted");
} // End of file delete process
[/php]
Its getting to this line:
[php]
if (!unlink($file))
[/php]
And telling me:
Error deleting 11515425661.jpg