简体   繁体   English

AFAmazonS3Manager错误

[英]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.

相关问题 位置管理器错误 - Location Manager error AFAmazonS3Client如何定义元数据? - AFAmazonS3Client how to define meta-data? 无法更新AFAmazonS3Client的Podfile,请修复 - Unable to update Podfile for AFAmazonS3Client please fix 在管理器 loadFromPreferencesWithCompletionHandler 上获取权限被拒绝错误 - Getting Permission Denied error on manager loadFromPreferencesWithCompletionHandler 添加子层AVPlayer共享实例/管理器时出错 - Error adding sublayer AVPlayer Shared Instance/Manager 位置管理器不工作,信号量错误,未调用代表,为什么? - Location manager not working, semaphore error, delegates not being called, why? 如何解决 Swift Package Manager 目标重叠源错误 - How to resolve Swift Package Manager target overlapping sources error 如何修复CLLocation Manager失败并出现位置错误? - How to fix CLLocation Manager from failing with location error? swift objective-c 错误无法将类型 () -> () 的值转换为指定类型 MIDI.IO.Manager - swift objective-c error Cannot convert value of type () -> () to specified type MIDI.IO.Manager 尝试从Mac上的HID管理器获取HID设备引用时出现不兼容的指针错误 - Incompatible pointer error when trying to get a HID device reference from HID manager on Mac
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM