2

S3PutObjectRequest failed to execute after cancelling a prior request.

The user must be able to cancel the upload and replace the photo to be uploaded. If the user change his mind, He can always click the cancel button and that's gonna cancel the S3PutObjectRequest and go back to previous viewcontroller.

I can use this to cancel the request.

[self.uploadRequest cancel];

But after the request cancelled. I can't make another upload. I just called the same method for uploading to AmazonS3.

    self.s3 = [[AmazonS3Client alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY];
    self.s3.endpoint = [AmazonEndpoints s3Endpoint:[S3Region USStandard]];
    // 10 seconds timeout.
    //self.s3.timeout = 90; // 1.5 minutes timeout.
    self.transferManager = [S3TransferManager new];
    self.transferManager.s3 = self.s3;
    self.transferManager.delegate = self;
    self.transferManager.operationQueue.maxConcurrentOperationCount = 2;

I also tried cancelling all operations inside S3UploadTransferManager, All operations were cancelled right but I can't make another upload operation. Any Ideas why? and how can I cancel the upload operation properly. Been reading the AWS Documentation for a quite while now, still don't have an idea about this.

4

1 に答える 1