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 09:03:41 +0100
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.
I did:
--------------------
NSURL *movieUrl = [NSURL URLWithString:movieLink];
NSURLRequest *theRequest=[NSURLRequest requestWithURL:movieUrl
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:30.0];
And I tried to get the header fields with
--------------------
NSDictionary *dict = [theRequest allHTTPHeaderFields];
bul dict is always nil. Should I create it by myself?
How do create a new header field and set the offset?
Which name of the field does specify the offset value?
How to do? Thank you.
Best Regards
--
Lorenzo
email: email@hidden
>
From: Scott Anguish <email@hidden>
>
Date: Tue, 20 Jan 2004 15:13:15 -0500
>
To: Lorenzo <email@hidden>
>
Cc: email@hidden
>
Subject: Re: NSURLDownload step by step
>
>
You'd have to move to using NSURLConnection rather than NSURLDownload
>
and manage all the disk caching yourself. In addition, for continued
>
downloads you'd need to pass a new header field with the starting
>
offset.
>
>
Or, file a bug and ask that NSURLDownload support it natively. :-)
>
>
On Jan 20, 2004, at 10:11 AM, Lorenzo wrote:
>
>
> Hi,
>
> I use to download a large file from the web using the NSURLDownload
>
> APIs.
>
> Anyway if the user quits during the download, I lose the whole
>
> download.
>
> And the next time the user launchs the same download, I have to
>
> download the
>
> file again from the beginning. Instead I would like to save the
>
> downloaded
>
> data to a file on the local disk (e.g. File_001_Temp.txt) before
>
> quitting,
>
> and, at the next time the user re-launchs the SAME download, I append
>
> the
>
> new data to that file.
>
>
>
> How can I do download a file step by step?
>
> Any idea, sample code, would be appreciated. Thank you.
_______________________________________________
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.