ftplib storbinary problem

Robin Becker robin at jessikat.fsnet.co.uk
Fri May 18 10:17:04 EDT 2001


In article <mailman.990191606.31921.python-list at python.org>, Sandipan
Gangopadhyay <sandipan at vsnl.com> writes
>I am using storbinary('STOR a.jpg', openfilepointer, 1024) from the ftplib
>to upload a picture to an FTP server (server2031.virtualave.net)
>
>While this works fine with ASCII files, it is not working for .jpg where we
>need binary ! Depending on the block size (like 1024 above), only 274 bytes
>or so are getting uploaded. The function returns a successful transfer.
>
>I am trying this on pythonwin, on Win 98. I have tried blocksize range from
>0 to 10240000. I have tried both active and passive mode.
>
>Anyone know where I am going wrong ?
>
>Thanks,
>
>Sandipan
>
>
>
are you opening the openfile pointer thing in binary mode

eg
        f = open('bongo','rb')
-- 
Robin Becker



More information about the Python-list mailing list