Re: NSURLConnection and resumes
Re: NSURLConnection and resumes
- Subject: Re: NSURLConnection and resumes
- From: Rudi Sherry <email@hidden>
- Date: Wed, 06 Oct 2004 20:10:47 -0700
If the server accepts byte-range requests you could add a Range header
to the request; here's a sample:
[ URLRequest setValue: @"bytes=100032-433566" forHTTPHeaderField:
@"Range" ];
.. assuming you know how large the file is. The first number is the
byte offset from the beginning of the file and the second number is the
last byte offset that you'll receive (remember that it's inclusive, so
the last byte index is one less than the length of the file).
If the server allows byte-range requests, you'll probably get a
multi-part message with one part; if the server doesn't support them,
you'll get the entire file.
On Oct 6, 2004, at 4:51 PM, John Stiles wrote:
I'm using NSURLConnection with a custom delegate to download a large
file from the web.
If I have the first half of the file already, how can I ask for an
HTTP resume so I can start downloading from the middle? The data won't
be in the cache, since I got the partial download via a custom
networking protocol and not any NSURL code.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden