我從下面的代碼上傳圖片 -如何上傳圖像到ASW S3
NSData *imageData = UIImageJPEGRepresentation(image, 1.0);
AmazonS3Client *s3Client = [[[AmazonS3Client alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY] autorelease];
s3Client.timeout = 240;
NSString *bucketName = [NSString stringWithFormat:@"test/images/"];
NSString *imageName = [NSString stringWithFormat:@"testimage.jpg"];
S3PutObjectRequest *objReq = [[S3PutObjectRequest alloc] initWithKey:imageName inBucket:bucketName];
objReq.contentType = @"image/jpeg";
objReq.data = imageData;
objReq.delegate = self;
objReq.contentLength = [imageData length];
[s3Client putObject:objReq];
我收到以下錯誤 -
S3Response.m | - [S3Response連接:didFailWithError:] | 234 | UserInfo.NSUnderlyingError =錯誤域= kCFErrorDomainCFNetwork代碼= -1003「無法找到具有指定主機名的服務器。」 UserInfo = 0xac62aa0 {NSErrorFailingURLKey=https://test/images/.s3.amazonaws.com/testimage.jpg
請告訴我我做錯了什麼。
感謝您的答覆原子,我正在檢查。 – San007