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 presigned url regressions - :success_action_status #720

Closed
modosc opened this issue Feb 26, 2015 · 4 comments
Closed

s3 presigned url regressions - :success_action_status #720

modosc opened this issue Feb 26, 2015 · 4 comments
Labels
feature-request A feature should be added or improved.

Comments

@modosc
Copy link

modosc commented Feb 26, 2015

i just upgraded to v2 and found a few issues when generating a presigned url for an s3 object:

- unexpected value at params[:success_action_status]

:success_action_status doesn't seem to be supported anymore - this means that getting xml info back about the file after an upload won't work (see http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html)

@trevorrowe
Copy link
Member

The v2 SDK does not provide a pre-signed POST utility at this time. Can you give a code example of what you are doing that generates this error?

@modosc
Copy link
Author

modosc commented Mar 4, 2015

previously we were doing something like this:

    @s3_presigned_post ||= S3_BUCKET.presigned_post
       key: s3_key,
       success_action_status: 201,
       acl: 'bucket-owner-full-control'.to_sym,
       expires: ::S3_PRESIGNED_POST_EXPIRATION,
       content_length: (0..::S3_MAX_FILE_SIZE),
       content_type: get_content_type

to adapt to v2 i changed the code like so:

    @s3_object ||= Aws::S3::Object.new bucket_name: S3_BUCKET, key: s3_key
    @s3_presigned_post ||= @s3_object.presigned_url :put,
       success_action_status: 201,
       acl: 'bucket-owner-full-control'.to_sym,
       expires: ::S3_PRESIGNED_POST_EXPIRATION,
       content_length: (0..::S3_MAX_FILE_SIZE),
       content_type: get_content_type

when i try this i get the errors from #719 and this bug. commenting out the :success_action_status and :content_length lines will make the code work.

@trevorrowe
Copy link
Member

The #presigned_post method has no equivalent in the v2 SDK. I'm going to mark this as a feature request. Until this has been ported to the v2 SDK, you can continue using the v1 presigned post utility. You can use v1 and v2 in the same application.

@trevorrowe trevorrowe added feature-request A feature should be added or improved. and removed requesting feedback labels Mar 4, 2015
trevorrowe added a commit that referenced this issue Mar 27, 2015
`Aws::S3::PresignedPost` is a utility class that makes it possible
to upload a file from a web browser directly to Amazon S3.

See #720.
trevorrowe added a commit that referenced this issue Mar 27, 2015
`Aws::S3::PresignedPost` is a utility class that makes it possible
to upload a file from a web browser directly to Amazon S3.

See #720.
@trevorrowe
Copy link
Member

@modosc I've just submitted a pull-request to the main repository that adds pre-signed post support in v2. I would be interested in feedback: #752

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants