Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 Integration Documentation out of date #94

Open
varblob opened this issue Nov 25, 2015 · 10 comments
Open

S3 Integration Documentation out of date #94

varblob opened this issue Nov 25, 2015 · 10 comments

Comments

@varblob
Copy link

varblob commented Nov 25, 2015

I'm attempting to get S3 working and am struggling a bit. It looks like perhaps things have changed.

Here is what I have for signing at the moment still getting 403 forbidden when uploading, but that could be something else.

bucket_name = "bucket_name"
bucket = Aws::S3::Resource.new(region: 'region').bucket(bucket_name)
@s3_direct_post = bucket.presigned_post(
  key: "path to where you want to put it/${filename}", #${filename} is amazon magic
  success_action_status: "201",
  acl: "public-read",
  expires: 1.hours.from_now
)
# bucket name appears to be needed by the client in composing the url
render json: @s3_direct_post.fields.merge(bucket: bucket_name), status: :ok

Pulled this mostly from here https://devcenter.heroku.com/articles/direct-to-s3-image-uploads-in-rails

@digitaltoad
Copy link
Member

You are getting a 401 from the sign?

@varblob
Copy link
Author

varblob commented Nov 25, 2015

Sorry 403 from attempting to upload.

@digitaltoad
Copy link
Member

What is the body of the error?

@varblob
Copy link
Author

varblob commented Nov 25, 2015

Not very informative

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>......</RequestId>
<HostId>........</HostId>
</Error>

@digitaltoad
Copy link
Member

Seems like it may be related to something like this. https://forums.aws.amazon.com/thread.jspa?threadID=56531

@varblob
Copy link
Author

varblob commented Nov 25, 2015

Thanks for your help, I think I need to fix my policy file for the user. I'll let you know if it all works out.

@digitaltoad
Copy link
Member

That being said. I don't think there is anything wrong with how you are currently generating the policy rather there is something wrong with the aws user's rights.

@varblob
Copy link
Author

varblob commented Nov 25, 2015

yup user needed to have his rights updated, success! I'm leaving this issue open since the original bit maybe of use to others. If I have time next week I'll try and make a pull request for the documentation.

@digitaltoad
Copy link
Member

I may get to the documentation before that. I'm currently in the process of updating the outdated parts of the library including making the base library ember-cli compatible so the wrapper can be deprecated. Updating the docs around signing was on the list.

@varblob varblob changed the title S3 Integration S3 Integration Documentation out of date Nov 25, 2015
@varblob
Copy link
Author

varblob commented Nov 25, 2015

most awesome! thanks again for your help and for the lib. I renamed this issue to reference documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants