cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Extra bytes when downloading file

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 31 Jul 2003 17:26:54 +0200 (CEST)

On Thu, 31 Jul 2003, Jim Doutt wrote:

> I am interacting with a WEB server to generate & download data
>
> I can fill out the WEB page, and click on the "download data" button &
> get a file that is 6721536 bytes long.
>
> It seems that with CURL, I need a 2-step process. The first appears to
> generate the file on the WEB site
>
> curl -m 20 --trace trace.out --get
> "http://128.128.xxx.yyy/RETRIEVE.HTM?SEED=L?Z+ELZZ50000000&BEG=03%2F06%2F28&END=03%2F06%2F29&FILE=aqqa&REQ=Download+Data&DONE=YES"

You don't need --get in there. curl uses GET by default.

If that page uses Location: to lead you to the file to download, you can do it
in one step by using -L.

> and I can retrieve it with
>
> curl -O -m 20 --get "http://128.128.xxx.yyy/aqqa"
>
> However the retrieved file is 6729728 bytes long
>
> ls -alrt aqqa
> 6729728 Jul 31 10:50 aqqa
> ls -alrt ~/aqas
> 6721536 Jul 30 13:57 aqas
>
> If I do a cmp on the two files
> cmp -l ~/aqas aqqa
> cmp: EOF on /home/jdoutt/aqas
>
> SO the file downloaded by CURL seems to have "stuff" appended to the end.
>
> Can someone help me with the correct syntax for doing this?

Interesting. The syntax is correct, so there's something else that causes curl
to do this.

What curl version is this?

Can you use -i (or -v) on that second command line to show us the headers the
servers returns?

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-07-31