簡體   English   中英

AFAmazonS3Client如何定義元數據?

[英]AFAmazonS3Client how to define meta-data?

嗨,我使用AFAmazonS3Client並向我的aws服務器發送.mp3文件。 但是它的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);}];

嘗試這個:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM