On 23 Oct 2002 02:19:31 -0400, "Hubert Cross" > wrote: > >hi > >i am trying to download the paypal cvs history file using socketwrench. >I just get the headers and a few random characters and then the file is >cut off. i am wondering if this is because the socketwrench controls >cannot handle attachments? > ..... >and this is what I get back: > ..... >Transfer-Encoding: chunked >Content-Type: application/octet-stream > >1aa >Date, Time, Name, Type, Status, Subject, Gross, Fee, Net, Note, From >Email Address, To Email Address, Transaction ID, Payment >Type,Counterparty Status, Shipping Address, Address Status, Item Title, >Item ID, Shipping Amount, Insurance Amount, Sales Tax, Option 1 Name, >Option 1 Value, Option 2 Name, Option 2 Value, Auction House, Item URL, >Closing Date, Reference Txn ID, Invoice Number, Subscription Number, >Custom Number, > >0 > > >what am i doing wrong? can you help me? Hubert, The data returned by the server is "chunked" data. The last paragraphs in have an explanation of how to deal with chunked data. That article is oriented towards the SocketTools HTTP component, but the information about the HTTP protocol is valid of course if you are using SocketWrench. In particular the "1aa" is a chunk header that means: '1aa = 432 bytes follow this line. You're supposed to read exactly that many bytes, and then read another line to get the next chunk header, and interpret it, and so forth. Are you doing this? If you want to avoid this processing, you can try using HTTP/1.0 instead of HTTP/1.1, and also omit Connection: Keep-Alive ... from your request. Then the returned data will probably not be chunked, and you can just keep reading from the socket until the server closes the connection. The downside of this is that you have to establish a new connection for each request. The "0" on a line by itself is peculiar, though. If it's a complete line, it's a chunk header (footer?) indicating end of data, which suggests that the server is returning incomplete data. Hmm. Dan Stork