【发布时间】:2011-03-21 11:27:44
【问题描述】:
我打算使用 ASIHttpRequest 从后端服务器下载文件。在采取行动之前,请在此处发布问题以了解有关此功能的更多信息。
作为示例源代码:(演示下载远程 JPG 文件)
ASIHTTPRequest *request;
request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/images/small-image.jpg"]];
[request setDownloadDestinationPath:[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"1.png"]];
[request setDownloadProgressDelegate:imageProgressIndicator1];
[networkQueue addOperation:request];
我的问题是:
- 它可以下载任何格式的文件,如MP3、视频文件等?是否有任何限制,例如文件大小、超时?
好像只需要设置远程文件路径,“http://allseeing-i.com/ASIHTTPRequest/tests/images/small-image.jpg”,就可以通过HTTP协议远程下载所有东西了。
- 恢复功能怎么样?
它通过 YES/NO 提供“RESUME”设置,这足以满足正常的恢复功能吗?比如文件很大,暂停一下,然后希望从上次恢复。
感谢任何输入或 cmets,我需要先对此进行调查,然后再将其应用到我的项目中。提前致谢!
【问题讨论】:
标签: iphone ipad download asihttprequest