Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

AWS S3 PUT Request Question #45

Closed
gavinwilliams opened this issue Apr 22, 2014 · 12 comments
Closed

AWS S3 PUT Request Question #45

gavinwilliams opened this issue Apr 22, 2014 · 12 comments

Comments

@gavinwilliams
Copy link

I've literally spent the last 3 - 4 hours trying to do what should have been the simplest of tasks using AFAmazonS3Client.

When I use postObjectWithFile AWS S3 responds that POST isn't a supported method. When I switch over to putObjectWithFile the file is uploaded but isn't recognised as AFAmazonS3Client prepends the multipart data to the file.

I'll be honest, writing a digital SLR remote app today using a poorly documented Canon SDK has been less frustrating than using AFAmazonS3Client.

@conradwt
Copy link

conradwt commented Jun 9, 2014

@gavinwilliams Is there any update on this issue?

@dmzza
Copy link
Contributor

dmzza commented Jun 11, 2014

I'm having the same problem.

@marjinn
Copy link

marjinn commented Jun 11, 2014

#35

@mattt mattt changed the title Is this project still being maintained? AWS S3 PUT Request Question Jun 11, 2014
@dmzza
Copy link
Contributor

dmzza commented Jun 12, 2014

I've merged in evoL#1 as well as my own #46 and I now have a working version for PUT requests in my own branch 2.2: https://github.com/dmzza/AFAmazonS3Client/tree/2.2

To use my branch with CocoaPods:

pod 'AFAmazonS3Client', :git => 'https://github.com/dmzza/AFAmazonS3Client', :branch => '2.2'

@conradwt
Copy link

@dmzza Does your version work work with AFNetworking 2.2.x?

@dmzza
Copy link
Contributor

dmzza commented Jun 12, 2014

It was working on AFNetworking 2.1.0, and then I just updated it with CocoaPods to 2.3.0, and it still works. So I assume it works with 2.2.x as well.

@conradwt
Copy link

@dmzza What are the correct headers to use for AFAmazonS3Manager because I'm seeing symbol errors when setting both region and bucket?

@dmzza
Copy link
Contributor

dmzza commented Jun 12, 2014

This is what I'm using:

self.s3Manager = [[AFAmazonS3Manager alloc] initWithAccessKeyID:S3_ACCESS_KEY secret:S3_SECRET];
    [[self.s3Manager requestSerializer] setRegion:AFAmazonS3USStandardRegion];
    [[self.s3Manager requestSerializer] setBucket:@"..."];
    [[self.s3Manager responseSerializer] setAcceptableContentTypes:[NSSet setWithObjects:@"multipart/form-data", @"binary/octet-stream", nil]];

Although I shouldn't need @"multipart/form-data"

@conradwt
Copy link

@dmzza Awesome!!!! I'm guessing the you're importing:

#import <AFAmazonS3RequestSerializer.h>
#import <AFAmazonS3Manager.h>

@dmzza
Copy link
Contributor

dmzza commented Jun 15, 2014

I'm only importing this:

#import <AFAmazonS3Client/AFAmazonS3Manager.h>

That file imports the RequestSerializer.

@conradwt
Copy link

@dmzza Yes, I'm using the same header now after I looked at the headers for the framework. Next, it may be a good idea to update the README with header information as well as which how to set both the bucket and region. Thus, I'll submit a pull request today with these modifications.

@mattt
Copy link
Contributor

mattt commented Nov 29, 2014

Duplicate of #35. Fixed by cc21e90.

@mattt mattt closed this as completed Nov 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants