[英]AFAmazonS3Manager Error
I'm trying to use the AFAmazonS3Manager
in my app. 我正在尝试在我的应用程序中使用
AFAmazonS3Manager
。 I'm attempting to upload a photo to Amazon but I keep getting this error: 我正在尝试将照片上传到亚马逊,但我不断收到此错误:
Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo=0x1740e3f00 {NSUnderlyingError=0x170247dd0 "The requested URL was not found on this server.", NSErrorFailingURLStringKey=file:///var/mobile/Containers/Data/Application/myInfo, NSErrorFailingURLKey=file:///var/mobile/Containers/Data/Application/myInfo, NSLocalizedDescription=The requested URL was not found on this server.
My code for the thing is simply: 我的代码很简单:
AFAmazonS3Manager * s3Manager = [[AFAmazonS3Manager alloc]initWithAccessKeyID:amazonAccessKey secret:amazonSecret];
s3Manager.requestSerializer.region = AFAmazonS3USStandardRegion;
s3Manager.requestSerializer.bucket = amazonBucket;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:photoName];
[UIImagePNGRepresentation(photo) writeToFile:filePath atomically:YES];
[s3Manager postObjectWithFile:filePath destinationPath:@"" parameters:nil progress:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
int percent = roundf((float)totalBytesWritten / (float)totalBytesExpectedToWrite * 100);
NSLog(@"Percent Complete: %d%%",percent);
I've been at this problem for a couple of days. 我已经遇到了这个问题几天了。 I'm new to using AWS, so I have no clue what I'm doing wrong.
我是使用AWS的新手,所以不知道我在做什么错。
maybe you're passing an invalid request URL or it's an image that doesn't exist in the path you're giving, base on the error message.Please check the url path you're using if an image really exist there or if it's valid by copy pasting the url in your browser. 根据错误消息,可能是您传递的请求网址无效,或者您提供的路径中不存在该图像。请检查您使用的url路径,如果该图像确实存在或存在通过复制粘贴到浏览器中的网址有效。 here's a link that might also help you : http://www.splinter.com.au/2014/10/15/upload-to-s3-from-ios/
这是一个可能也对您有帮助的链接: http : //www.splinter.com.au/2014/10/15/upload-to-s3-from-ios/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.