Asokan R
Asokan R

Reputation: 143

How to stop/cancel the download request in aws 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];

This is the code snippet am using for download.

Upvotes: 3

Views: 2674

Answers (1)

Yosuke
Yosuke

Reputation: 3759

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

Upvotes: 4

Related Questions