AFAmazonS3Client如何定义元数据?

时间:2014-09-20 17:06:22

标签: objective-c amazon-s3

您好我正在使用AFAmazonS3Client和我发送.mp3文件到我的aws服务器。但它的Content-Type不是“audio / mpeg”我怎么能改变它。

AFAmazonS3Manager *s3Manager = [[AFAmazonS3Manager alloc] initWithAccessKeyID:@"..." secret:@"..."];
s3Manager.region = AFAmazonS3USWest1Region;
s3Manager.bucket = @"my-bucket-name";

[s3Manager postObjectWithFile:mp3FilePath
          destinationPath:@"/"
               parameters:nil
                 progress:^(NSUInteger bytesWritten, long long totalBytesWritten, long     long totalBytesExpectedToWrite) {
                    NSLog(@"%f%% Uploaded", (totalBytesWritten / (totalBytesExpectedToWrite * 1.0f) * 100)); }success:^(id responseObject) {
                    NSLog(@"Upload Complete"); } failure:^(NSError *error) { NSLog(@"Error: %@", error);}];

1 个答案:

答案 0 :(得分:0)

试试这个:

s3Manager.responseSerializer = [AFJSONResponseSerializer serializer];
s3Manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"audio/mp3"];