I accidentally created a file with PHP and now I can't delete or re-name it.
The file is called â€%C2%9Dâ2™j299t™93.gif
Edit: I only have access via FTP, the host is Linux based
Edit 2: I can't even delete the directory it is in.
From PHP you can use the unlink
function as follows:
<?php
$filename="â€%C2%9Dâ2™j299t™93.gif";
unlink($filename);
?>
The problem you have been having is probably to do with the ™ symbol being translated. If you copy the code above and paste it into your editor and then run it, this should delete the file, assuming it is run from the same directory as the file.
Download Filezilla and set site encoding to enforced utf-8. Then try to delete your file via it.
In the command line, write:
ftp to.target.server
del *93.gif
If you are the owner of the file, this should work (permissions were 644)
I guess you don't know the exact filename (as your ftp client does not show it in a proper way). You can iterate thru files. This example deletes all files with the character %
in it. Use it carefully:
$d = dir(".");
while (false !== ($entry = $d->read())) {
if (strpos ($entry, '%') !== false) {
unlink ($entry);
}
}
$d->close();