Re: NSURLDownload step by step
Re: NSURLDownload step by step
- Subject: Re: NSURLDownload step by step
- From: Lorenzo <email@hidden>
- Date: Tue, 27 Jan 2004 13:47:39 +0100
Hi,
thank you so much.
I took a look at the CURLHandle and to www.w3.org looking for code useful
for my code but I didn't find what I need. Sorry. I don't know the right
sintax to translate the sample I saw to the Cocoa request.
In the meantime I added the HeaderField "Range" in my NSMutableURLRequest:
[theRequest addValue:@"bytes=0-199" forHTTPHeaderField:@"Range"];
or
[theRequest addValue:@"\"Range\" \":\" bytes\"=\"0-199"
forHTTPHeaderField:@"Range"];
Even if I presume that both the values are wrong, when I ask
[(NSHTTPURLResponse*)response allHeaderFields];
now a new field appears in the Dictionary:
"Accept-Ranges" = bytes;
I know this means that I can request a download range by range from that
server, but I don't know well the sintax to perform the right request.
I walked around on the web but all the samples seems to be the same.
The are strings like:
ranges-specifier = byte-ranges-specifier
byte-ranges-specifier = bytes-unit "=" byte-range-set
byte-range-set = 1#( byte-range-spec | suffix-byte-range-spec )
byte-range-spec = first-byte-pos "-" [last-byte-pos]
first-byte-pos = 1*DIGIT
last-byte-pos = 1*DIGIT
And I don't know how to trasform this code to the right Cocoa request.
Best Regards
--
Lorenzo
email: email@hidden
>
From: Sherm Pendley <email@hidden>
>
Date: Tue, 27 Jan 2004 03:47:04 -0500
>
To: Lorenzo <email@hidden>
>
Cc: cocoa-dev Development <email@hidden>, Scott Anguish
>
<email@hidden>
>
Subject: Re: NSURLDownload step by step
>
>
On Jan 27, 2004, at 3:03 AM, Lorenzo wrote:
>
>
> Hi,
>
> sorry if I ask again, I did what you said. I used NSURLConnection and
>
> at the
>
> end of the download I save the NSData to the disk. Fine.
>
> But, I cannot yet start a download from a given offset.
>
>
Have you looked at CURLHandle? <http://curlhandle.sourceforge.net>
>
>
In particular, it has a -setRange: method that you might find useful.
>
>
sherm--
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.