0
我正在从网上下载文件。当我重新开始下载文件时,它会从起点再次重启,而不是从暂停下载的位置重新开始。在我暂停下载的时候,我保存了下载文件的值。但现在我无法如何恢复已暂停的文件的下载。 我使用此代码来下载新文件使用ASIHTTPRequest恢复下载
url = [NSURL URLWithString:_item.link];
_receivedBytes = 0;
_speed = 0;
_lastTime = [[NSDate date] timeIntervalSince1970];
_connection = [ASIWebPageRequest requestWithURL:url];
[_connection setUrlReplacementMode:ASIReplaceExternalResourcesWithData];
[_connection setDelegate: self];
[_connection setDownloadProgressDelegate:self];
[_connection setDownloadCache:[ASIDownloadCache sharedCache]];
[_connection setDownloadDestinationPath: _item.path];
[_connection startAsynchronous];
我已经改变了它ASIHTTPRequest,但是当我重新开始下载,进度视图中再次从零字节开始。 – 2012-08-02 08:57:10
您是否按照ASIHTTPRequest文档“恢复中断的下载”中的说明实现了它? – joern 2012-08-02 08:59:40
恢复下载的代码是 – 2012-08-02 09:03:12