#1
  1. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154

    Quick ftplib Question


    I was just had a quick question about ftp.storbinary() in the ftplib module. When I do:
    Code:
    ftp.storbinary('STOR monitor.xsl', open('monitor.xsl'))
    I know that open('monitor.xml') is the file that is being uploaded to the ftp server, but what I need to know:
    is STOR monitor.xml uploading the file with the name monitor.xml? If I did:
    Code:
    ftp.storbinary('STOR monitor2.xsl', open('monitor.xsl'))
    Would Python upload monitor.xml with the file name of monitor2.xml?
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    You follow the STOR command by the name of the file you want to create, so whatever filename you do put after STOR in this case monitor2.xsl will be the name of the file created on the server .

    Mark.
    programming language development: www.netytan.com Hula

  4. #3
  5. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    Ok thanks, that's good.

IMN logo majestic logo threadwatch logo seochat tools logo