cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Range Request : gets only contents without header in contents.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 14 Apr 2003 09:36:58 +0200 (CEST)

On Mon, 14 Apr 2003, [ks_c_5601-1987] ¹Ú³²±Ô wrote:

> I want to get range of contents from response, so I did like :

> curl -s -N -m 60 --connect-timeout 30 -D output.head -r 0-40 -o output.wav
> http://medpharm.university.ac.kr/aldja/netpharmacology2000/MEXILETI1.WAV
>
> Almost are successfully downloaded by range. But, some file(such as above)
> has content mixed with http header like :
>
> ^M
> --multipart-boundary
> Content-type: audio/x-wav^M
> Range: bytes 0-40/82988^M
> ^M
> RIFF$D^A^@WAVEfmt ^P^@^@^@^A^@^A^@D?@^@~HX^A^@^B^@^P^@data^@^M
> --multipart-boundary--^M
>
> How I get only contents without header in content? I don't know what
> options exists for this.

Hi

No, there are no options in curl to cut off headers like this.

When an HTTP server is given a request such as the one you showed above, it
should *not* reply with this kind of multipart mime stuff (with boundaries
and all) since the reply is one single part. This is the kind of reply you
should expect if you ask for more than one non-overlapping range.

Curl does not provide any options or functions to filter or alter this
downloaded content.

You do best to pipe this output into a clever program/script that knows how
to strip off this protocol violation.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-04-14