Problem:
unlink()
is not working with a period .
in the foldername path. It works without a period in the path though.
What I have tried:
I tried the escaping method. no luck.
$imagetodelete = $_GET['imagetodelete'];
$delete = $_GET['delete'];
if ($delete == "yes") {
error_reporting(E_ALL); #ini_set('display_errors', 1);
$dir = ('/var/www/example.com/pictures.gif.collection/');
directory
$dir = str_replace(".", "\\.", $dir);
and
$dir = str_replace(".", "\.", $dir);
I combined them into $filepath
$filepath = "/www/example.com/pictures.gif.collection/$imagetodelete";
unlink($filepath);
}
errors are Permission denied (if directory name has dots makes no sense) php script, file to delete, and folder are all set to 777
the above only works if$filepath = "/www/example.com/picturesgifcollection/image.jpg";
(no dots)
I also tried:
unlink not working with space in foldername path