#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Posts
    28
    Rep Power
    0

    Couple of FTP questions


    Hi

    I'm integrating a ftp uploader into a Flash Air project.

    It's working well, apart from the fact that I cannot delete more than one file at a time on the server.

    I can successfuly delete a file if I specifically name it, but can't make flash delete everything in a given folder...

    s.writeUTFBytes("DELE "+remoteFolderStr+"/menu/contact.php\n");

    ... successfully deletes contact.php, but (and this is after I've added a test file back into the 'menu' dir)...

    s.writeUTFBytes("DELE "+remoteFolderStr+"/menu/*.*\n");

    ...gives me a 550 error...

    550 Could not delete public_html/menu/*.*: No such file or directory

    I thought the *.* meant 'everything'. If not, is there a way to do it?


    The second questions relates to the different ftp server systems that are out there. Is it correct that there are different sets of return codes? I understand that you can prompt the server to see what system it is using, but I was wondering if there is a list somewhere of a) what systems are available, and b) their return codes?

    Thanks for your time and help.

    Shaun
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    The commands and return codes that are available on FTP servers are mostly standardized, although some FTP servers do offer custom commands or return codes that are not. Here's a list of standard return codes: http://en.wikipedia.org/wiki/List_of...r_return_codes

    To the best of my knowledge, standard FTP does not include a wildcard or a recursive delete. You need to delete files and directories one by one. Also note that in almost all cases the FTP server will not allow you to delete a directory that is not empty.

    *.* never really means everything; within the context of most operating system shells it means any file that has text, a dot and then more text. In a lot of cases that essentially means all files, but it's certainly possible to have a file without a dot or without text on one side of the dot, and *.* would not match those files. It's sort of besides the point though, since FTP doesn't support it anyway.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,451
    Rep Power
    1751
    Try the mdelete command?
    Code:
    ftp> help mdelete
    mdelete         Delete multiple files
    ftp>
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Posts
    28
    Rep Power
    0
    Thanks guys

    That return codes list is certain helping out.

    Much appreciated.

    Shaun

IMN logo majestic logo threadwatch logo seochat tools logo