如何停止/取消AWS S3下载请求AWS

由网友(背着书包去打架)分享简介:在下载来自Amazon S3的文件,我试图取消/停止文件。但我不能得到任何的解决方案。所以好心建议我一个解决方案。谢谢While downloading files from amazon s3, I have tried to cancel/stop the file . But i cant get any so...

在下载来自Amazon S3的文件,我试图取消/停止文件。但我不能得到任何的解决方案。所以好心建议我一个解决方案。谢谢

While downloading files from amazon s3, I have tried to cancel/stop the file . But i cant get any solutions. So kindly suggest me a solution. Thanks

S3GetObjectRequest *downloadRequest = [[[S3GetObjectRequest alloc] initWithKey:path withBucket:SECRET] autorelease];
    downloadRequest.delegate=self;
    [s3 getObject:downloadRequest];
    NSData *myData2;
        myData2 = response.body;
        [myData2 writeToFile:filePath atomically:YES];

这是在code段是用下载了。

This is the code snippet am using for download.

推荐答案

S3GetObjectRequest 有一个叫做财产 URLConnection的。您可以拨打取消的URLConnection 属性取消下载请求。

S3GetObjectRequest has a property called urlConnection. You can call cancel on the urlConnection property to cancel your download request.

阅读全文

相关推荐

最新文章