Re: newbie question: ftp.storbinary()

Discussion in 'Python' started by Facundo Batista, Jan 24, 2007.

  1. Scott Ballard wrote:

    > Sorry for the lame question, I'm still trying to pick up Python and new to
    > the list here.


    Welcome!


    > I'm assuming that I should use storbinary( command, file[, blocksize]) to
    > transfer the files. the documentation says "command should be an appropriate
    > "STOR" command: "STOR filename"."


    For example:

    >>> fp = open("/tmp/file_to_transfer.txt") # open the file
    >>> self.ftp.storbinary("STOR file_to_transfer.txt", fp) # note that the name has not the path
    >>> fp.close() # close the file, :)


    Regards,

    --
    .. Facundo
    ..
    Blog: http://www.taniquetil.com.ar/plog/
    PyAr: http://www.python.org/ar/
    Facundo Batista, Jan 24, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gerrit Holl
    Replies:
    0
    Views:
    880
    Gerrit Holl
    Dec 29, 2003
  2. Scott Ballard

    newbie question: ftp.storbinary()

    Scott Ballard, Jan 23, 2007, in forum: Python
    Replies:
    1
    Views:
    590
    Ayaz Ahmed Khan
    Feb 3, 2007
  3. Gabriel Genellina

    Re: newbie question: ftp.storbinary()

    Gabriel Genellina, Jan 24, 2007, in forum: Python
    Replies:
    0
    Views:
    401
    Gabriel Genellina
    Jan 24, 2007
  4. Florian  Demmer

    Interrupting ftplib.storbinary()

    Florian Demmer, Apr 26, 2007, in forum: Python
    Replies:
    3
    Views:
    301
    billiejoex
    Apr 29, 2007
  5. D. Buck
    Replies:
    2
    Views:
    447
    D. Buck
    Jun 29, 2004
Loading...

Share This Page