我將15張照片上傳到AWS S3(v2),並且我想顯示每張照片的進度。使用適用於iOS的AWS S3 SDK v2上傳圖像:跟蹤進度
首先,我爲每張照片創建了一個AWSS3TransferManagerUploadRequest。
AWSS3TransferManagerUploadRequest *uploadRequest = [AWSS3TransferManagerUploadRequest new];
// load uploadRequest atts...
uploadRequest.uploadProgress = ^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
int progress = (int)(totalBytesSent * 100.0/totalBytesExpectedToSend);
DDLogInfo(@"%d", progress);
}
然後創建了一個的NSArray BFTask的
BFTask *task = [self.s3transferManager upload:uploadRequest];
[tasks addObject:task];
最後:
[[BFTask taskForCompletionOfAllTasks:tasks] continueWithExecutor:[BFExecutor mainThreadExecutor] withBlock:^id(BFTask *task) {
if (task.error != nil) {
DDLogError(@"Error: [%@]", task.error);
} else {
DDLogInfo(@"Complete!");
}
return nil;
}];
我的問題是,隨着 「上傳進度」 相關聯的塊執行用於第一4倍的照片和那麼其餘的只是上傳,但沒有跟蹤進度。
有什麼想法?
謝謝!
這似乎是一個錯誤:HTTPS ://github.com/aws/aws-sdk-ios/issues/91#issuecomment-69859140 – dms90 2015-01-14 17:14:31