Solving FTP Deletion Error “550 Prohibited file name”

Trying to delete a file via FTP and unable to? Getting a “550 Prohibited file name” error? Annoying! But also very easy to fix. Create a php file called “unlink.php” with this code, replacing the “YOUR-FILENAME-HERE” with–what else?–your undeleteable file name.

<?php unlink('YOUR-FILENAME-HERE');?>

Upload it to the directory with the file in question, and visit the script in your web browser. It will remove the previously unruly file. ((Thanks to irasmith’s forum post for this solution.))

PHP noobs, please remember to have NO blank spaces before or after the beginning of your code in PHP files, or you’re liable to get a “Cannot modify header information/Headers already sent” error. You can create the file in a text program and simply rename it with a .php extension.

Share Button

14 thoughts on “Solving FTP Deletion Error “550 Prohibited file name””

  1. Your solution doesn’t work with a file with a name like D’Hondt_2011.jpg and File Permissions 644.
    The error message is: ‘Unable to access …’ and I’m not able to change the File Permissions to 755 or 777.
    Is there a workaround to solve this?

  2. Dutch, I have no idea. I posted this after I had the issue myself and did web searches to solve it. If it were me having trouble deleting a file that’s oddly named, I’d try changing the file name first but have no idea if you’ve already tried that or not.

  3. Thanks for your answer, Dixie. I’v tried almost everything I could think of with Total Commander and WS-FTP, but the file is not accessible at all. Can’t change the name/permissions nor copy, delete.

  4. Thanks, worked for me too !
    Instead of unlink(), I used rename(‘old_file/folder’, ‘new_file/folder’), then after I deleted my corrupted folder.

Leave a Reply to Dee Cancel reply

Your email address will not be published. Required fields are marked *