Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Cambridge, UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question 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.p...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

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    Australia
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    & 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

    PHP Code:
    <?
    unlink
    ('this.gif');
    ?>
    but if your host allows SSH it is far easier!
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #4
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Cambridge, UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!

  • #5
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    404
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #6
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    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
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #7
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Cambridge, UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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/PhpMyExplor...pMyExplorerMU/
    Last edited by opheliana; 07-10-2002 at 08:00 PM.

  • #8
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    404
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

    PHP Code:
    <?
        unlink
    ("/local/server/path/to/directory/this.gif");
    ?>
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #9
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Cambridge, UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!

  • #10
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Cambridge, UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •