5
Zamieszczam obraz do Amazon S3 za pośrednictwem AFNetworking i otrzymuję dziwny błąd. Plik jest przesłaniem, ale gdy natrafi 100% zwraca błąd:Zamówienie posta Amazon S3 z AFNetworking
Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: method not allowed (405)"
AFAmazonS3Manager *s3manager = [[AFAmazonS3Manager alloc] initWithAccessKeyID:AWS_Access_Key secret:AWS_Secret_Key];
s3manager.requestSerializer.region = AFAmazonS3USWest1Region;
s3manager.requestSerializer.bucket = AWS_Bucket_Name;
//setting for image url name
NSString* destionationPathForS3 = @"1234567";
[s3manager postObjectWithFile:self.filePath
destinationPath:destionationPathForS3
parameters:nil
progress:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
NSLog(@"%f%% Uploaded", (totalBytesWritten/(totalBytesExpectedToWrite * 1.0f) * 100));
}
success:^(id responseObject) {
NSURL *resultURL = [s3manager.requestSerializer.endpointURL URLByAppendingPathComponent:destionationPathForS3];
NSLog(@"Upload Complete: %@", resultURL);
}
failure:^(NSError *error) {
NSLog(@"Error: %@", error);
}];
Zbiorczy publiczny dostęp "WRITE": jest to czasami określane jako "włóż" lub "prześlij". Pozwala każdemu dodawać/usuwać/zamieniać obiekty w wiadrze Amazon S3. Szczegóły - https://aws.amazon.com/articles/Amazon-S3/5050 – avi