Thread: recursive FTP

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    Berlin
    Posts
    11
    Rep Power
    0

    recursive FTP


    Hi!

    I have the following problem:
    For my system I need write-access to every file on the server. As they are in many directories and subdirs it would be horrible for the user to change all these attributes manually.

    I imagine a php script which connects to the FTP-Server and recursively goes through the directory tree and changes all the attributes to the desired value.

    But: I don't have an idea how to do this. Perhaps you could help me!

    Thanx


    Filip
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    Is your server unix? if so it may be easier to create a directory listing vis readdir see www.php.net/readdir and then use some basic unix commands to change the permissions for you,
    i.e
    <?exec("chmod 777 *.*");?> would chmod all the files in the current directory to 777

    not that I would recommend doing this anyway!, perhaps better to check if someone is authorised to modify a file then change the permissions on just that file and change them back after they have done whatever they have to do, via script as above.
    resistance is no longer futile :: 423
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    Berlin
    Posts
    11
    Rep Power
    0
    Hi!

    This doesn't work because the apache webserver runs under the UNIX account "anonymous". But the creator of the files is my ftp-account called ftpXYZ, so the webserver can't change the file attributes because it isn't the creator of the files.

    With files created by the system this works fine, but not with uploaded files.

    Thanks for your reply, either.

    Filip

IMN logo majestic logo threadwatch logo seochat tools logo