尝试将大于 5 mb 的文件上传到 Amazon S3
http://aws.amazon.com/articles/0006282245644577,这里说
// The S3UploadInputStream was deprecated after the release of iOS6
5 mb 以下的文件我可以通过 wifi 轻松上传:
NSData *dataForAamzon = [[NSFileManager defaultManager] contentsAtPath:pathForFiile];
@try {
NSString *uploadName= @"somestring";
S3PutObjectRequest *por = [[S3PutObjectRequest alloc] initWithKey:uploadName
inBucket:[Constants userEventBucket]];
por.contentType = nil;
por.data = dataForAamzon;
// Put the image data into the specified s3 bucket and object.
S3PutObjectResponse *putObjectResponse = [self.s3 putObject:por];
[self performSelector:@selector(uploadAllFilesToAmazon:error:) withObject:nil withObject:putObjectResponse.error];
}
@catch ( AmazonServiceException *exception ) {
NSLog( @"Upload Failed, Reason: %@", exception );
}
由于S3UploadInputStream *stream
已弃用,如何检查文件是否大于 5mb 并在 IOS 6 或更高版本中使用分段上传。
谢谢,