[Tutor] ftp file size puzle
alan.gauld@bt.com
alan.gauld@bt.com
Thu, 27 Jun 2002 11:41:07 +0100
------_=_NextPart_001_01C21DC7.24AED450
Content-type: text/plain; charset="ISO-8859-1"
> I am running into an FTP problem.
> Basically, I am just trying to work out the very basics of ftplib,
Caveat, I've no experience of ftplib...
>>> ftp.storbinary("STOR foo.pdf", file, 8192)
'226 Transfer complete. 1200 bytes in 0 sec. (0.00 Kb/s).'
Right, so I get an "all OK" message. Except that the foo.pdf file is
actually 500KB big,
not 1KB!
I know you used strorbinary as a method but is there any possibility
it still used ASCII? Thats the usual ftp reason for truncating files...
Are there flags you can use to set binary/ASCII as the 'mode' or something?
Just guessing...
Alan G.
------_=_NextPart_001_01C21DC7.24AED450
Content-type: text/html; charset="ISO-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=280124310-27062002><FONT face="Courier New" color=#0000ff
size=2> > </FONT></SPAN>I am running into an FTP
problem. <SPAN class=280124310-27062002><FONT face="Courier New"
color=#0000ff size=2> </FONT></SPAN></DIV>
<DIV><SPAN class=280124310-27062002><FONT face="Courier New" color=#0000ff
size=2>> </FONT> </SPAN>Basically, I am just trying to work out the very
basics of ftplib, <SPAN class=280124310-27062002><FONT face="Courier New"
color=#0000ff size=2> </FONT></SPAN></DIV>
<DIV><SPAN class=280124310-27062002></SPAN> </DIV>
<DIV><SPAN class=280124310-27062002><FONT face="Courier New" color=#0000ff
size=2>Caveat, I've no experience of ftplib...</FONT></SPAN></DIV>
<DIV><SPAN class=280124310-27062002><FONT face="Courier New" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV>>>> ftp.storbinary("STOR foo.pdf", file, 8192)<SPAN
class=280124310-27062002><FONT face="Courier New" color=#0000ff
size=2> </FONT></SPAN></DIV>
<DIV><SPAN class=280124310-27062002> </SPAN>'226 Transfer complete. 1200
bytes in 0 sec. (0.00 Kb/s).'</DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV>Right, so I get an "all OK" message. Except that the foo.pdf file is
actually 500KB big, <SPAN class=280124310-27062002><FONT
face="Courier New" color=#0000ff size=2> </FONT></SPAN></DIV>
<DIV>not 1KB! <SPAN class=280124310-27062002><FONT face="Courier New"
color=#0000ff size=2> </FONT></SPAN></DIV>
<DIV><SPAN class=280124310-27062002><FONT face="Courier New" color=#0000ff
size=2></FONT></SPAN> </DIV></BLOCKQUOTE>
<DIV dir=ltr><SPAN class=280124310-27062002><FONT face="Courier New"
color=#0000ff size=2>I know you used strorbinary as a method but is there any
possibility </FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=280124310-27062002><FONT face="Courier New"
color=#0000ff size=2>it still used ASCII? Thats the usual ftp reason for
truncating files...</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=280124310-27062002><FONT face="Courier New"
color=#0000ff size=2>Are there flags you can use to set binary/ASCII as the
'mode' or something?</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=280124310-27062002><FONT face="Courier New"
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=280124310-27062002><FONT face="Courier New"
color=#0000ff size=2>Just guessing...</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=280124310-27062002><FONT face="Courier New"
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=280124310-27062002><FONT face="Courier New"
color=#0000ff size=2>Alan G.</FONT></SPAN></DIV>
<DIV dir=ltr> </DIV></BODY></HTML>
------_=_NextPart_001_01C21DC7.24AED450--