Results 1 to 5 of 5
Like Tree2Likes
  • 1 Post By alemoppo
  • 1 Post By alemoppo

Thread: Delete files and Folders impossible

  1. #1
    vbaddict is offline Junior Member
    Join Date
    Jul 2015
    Posts
    3

    Default Delete files and Folders impossible

    Hi everyone,
    I have an issu to delete file and folder into my ftp using filezilla.
    I would delete the file or folder but my Chmod is not good,so to do that you say me change Chmod, (of course)
    but I do not understand why I do not have the good name of owner/group.
    my request, how I could change the group name or how I could delete my file without ftp and wrong permission ?
    I have tried to explain you my situation in order to find a solution.
    Sorry for my English (I am French)
    Best regards.
    Last edited by vbaddict; 11-03-2017 at 01:08 PM.

  2. #2
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    286

    Default

    You should be able to change easly chmod by filezilla with right-click on file/folder -> "File permission...". Normally is set at "664".

    How you are trying to delete folder?

    I think the problem is not chmod. If you are trying to delete someting with special characters, you should delete with PHP, by a simle script using unlink() function.

    Bye!
    Last edited by alemoppo; 11-06-2017 at 02:54 PM.
    vbaddict likes this.

  3. #3
    vbaddict is offline Junior Member
    Join Date
    Jul 2015
    Posts
    3

    Default

    Tanks you for your answer
    but I tried and failed,each solution you propose.
    I have been trying by Filezilla,by Php script and I am not able to delete or change permission of only both two files and on folder.
    the other folders and files on my web site do not cause any problem.
    I think the problem come from the owner/group are different than the older file and folder without this issu.
    I will contact the moderator of Altervista to have an explication about Why I have two differents owner and group.
    Best regards.

  4. #4
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    286

    Default

    What about control panel? Can you delete the file from control panel?

    ---

    The last solution i propose is to try this simple script. Be sure before using it to make backup!

    PHP Code:
    <?php
    $i
    =0;
    if(!isset(
    $_GET['n_file']))
            echo 
    'Select file to delete: <br>'.PHP_EOL;

    foreach (
    glob("./*") as $filename)
    {
        
    $found[] = $filename;
        if(!isset(
    $_GET['n_file']))
        echo 
    '<a href="'.$_SERVER['PHP_SELF'].'?n_file='.$i++.'">'.$filename.'</a><br>'.PHP_EOL;
    }
    if(isset(
    $_GET['n_file']))
    {
        if(!
    file_exists($found[$_GET['n_file']]))
           die(
    'The file '.$found[$_GET['n_file']].' doesn\'t exist');

        if(
    unlink($found[$_GET['n_file']]))
            echo 
    'file '.$found[$_GET['n_file']].' deleted';
        else
            echo 
    'there are some problems with unlink()';
        
        echo 
    '<br><br><a href="'.$_SERVER['PHP_SELF'].'">reload</a>';
    }
    ?>
    Just create a php file in the directory you want delete the file, then paste the code, visit the page and click on file you want to delete.

    The file appears in the list? What is the script response?

    Bye!
    Last edited by alemoppo; 11-08-2017 at 04:55 PM.
    vbaddict likes this.

  5. #5
    vbaddict is offline Junior Member
    Join Date
    Jul 2015
    Posts
    3

    Default

    Hi,
    thanks for sharing this script.
    before trying your code,I do not understand why,but I made a backup,I created a new file like you said me, and paste your code inside.
    I would try to launch my new page to follow your advice and saw miracle my owner and group was all ok inside my sheet of Filezilla program ,so I could delete my file and folder without using your code or new page I have created.
    Now my problem seems ok.
    I have to thank you for your investigation and I save your solution into my computer if one day I need to use that way.
    Again thanks.
    Regards.

Posting Permissions

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

SEO by vBSEO