Jump to content

Deleting file from a directory


luvlemonade

Recommended Posts


$foto = $row['foto'];
$path_to_file = "../catalogue_images/".$foto;
unlink($path_to_file);


 

That should work if permissions are set...just make sure to get the path correct...it is relative to where the running script is located.  So if it is located one level above that then you have ../catalogue_images

if it is a folder within the same directory as the script it is simply "catalogue_images/".$foto

 

Sorry if you already know that stuff, but maybe you don't

Archived

This topic is now archived and is closed to further replies.

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