Helpful Information
 
 
Category: Other server side languages / issues
Invisible files/folders in WS-FTP

I recently tried to implement a multi-user PHP upload script on my site, but it didn't really work out so I eventually decided to delete it and find a different script.
But something weird has happened - some of the sub-folders and files in them have become invisible and in one folder, although the files (some .gif's and .php's) are visible WS-FTP won't allow me to delete them.

I tried to install PhpMyExplorer if that's any help - I've posted a message on the forum at it's homepage:http://elegac.free.fr/commun/index.php3?stats=true&langue=uk
but I thought I might get a better response here.

Does anyone know how I could delete these files and folders to stop them cluttering up my webspace?? Thanks :)

You might want to check that they have the chmod values of 777.

Right click on the file and then chose the option chmod. Make sure that all 9 options are checked. Once you have done that then try and delete them

Hope this helps

wabirdman

& if that does not the problem is probably ownership

because the uploaded files were 'created' via script they are now owned by apache and not you (username)..

if you have SSH access then login and delete the files from there, else CHOWN them to 'username' 'username' and you should be able to delete them via FTP

you can also try deleting them via script



<?
unlink('this.gif');
?>


but if your host allows SSH it is far easier!

Please forgive my ignorance, but what is 'CHOWN'? And I don't think I have SSH access - although I probably wouldn't know if I did!
And I don't really understand what you mean by 'deleting via a script' - what do I name this script and where do I put it?
I am unable to CHMOD the folders - I get an error - "550: Permission denied".

Thanks for your help!

CHOWN takes ownership of the file, CHOWN -user- would make that user the owner of that file...unless you have root access, only the owner of a specific file can perform actions on that specific file (this often can include directories). When a script creates a directory/file, unless it is wrapped in a setuid wrapper, the file/directory is owned by 'nobody' (at least on apache, typically). When you log in, you login as you, not as nobody, thus the files become off limits to you...which is where CHOWN comes into play.

save this as whatever.php in the same folder as your images just cjange the name of the file to suit one of the images you want to lose..


<?
unlink('this.gif');
?>

then call that file in your browser i.e. yourdomain.com/folder/whatever.php

and see if it deletes the file for you, if it does post again and we can make a script that deletes all the files in a given folder for you - just need to know if it works first

Thanks, but it won't even let me upload the whatever.php to the same folder (550: permission denied)......

This is the url to the folder that contains the images and .php files:
http://www.opheliana.net/PhpMyExplorerMU/none/PhpMyExplorerMU/

Ah, so the directory isn't owned by you either...

If that directory resides in another directory that is owned by you, then you can delete that directory entirely. Or you can run the script as nobody outside of the directory you are trying to work with and remove the files that way...(or the directory in entirety)

Try



<?
unlink("/local/server/path/to/directory/this.gif");
?>

Right, so I created a file called whatever.php and placed the above code in it with the path to the directory. I put this .php in my base directory (www.opheliana.net/whatever.php) and this is what it came out with:

Warning: Unlink failed (No such file or directory) in /home/www/ophelian/whatever.php on line 2

No such file or directory? But they do exist!

Sorry - ignore the last post - all files have been deleted! Thanks for that little piece of code, I'll keep it for future use ;)
However, the directory which housed the files will still not budge....any ideas?










privacy (GDPR)