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::Object upload_file content_type option not recognized #684

Closed
cmather opened this issue Jan 13, 2015 · 5 comments
Closed

S3::Object upload_file content_type option not recognized #684

cmather opened this issue Jan 13, 2015 · 5 comments
Labels
guidance Question that needs advice or information.

Comments

@cmather
Copy link

cmather commented Jan 13, 2015

The s3 object upload_file method fails when uploading a ~16MB file using multi-part upload when I set a content_type: 'video/mp4' option on the upload_file method. The error is:

Aws::S3::MultipartUploadError: multipart upload failed: unexpected value at params[:content_type]

Also see attached screenshot.

The upload works correctly, even with the content_type option, if I use the put method instead.

screen shot 2015-01-12 at 8 54 50 pm

@trevorrowe
Copy link
Member

Thanks for reporting the issue. I've applied a fix that should go out with this week's release.

@cmather
Copy link
Author

cmather commented Jan 15, 2015

Sweet!

On Jan 14, 2015, at 4:14 PM, Trevor Rowe notifications@github.com wrote:

Closed #684 via amazon-archives/aws-sdk-core-ruby@3e33d31.


Reply to this email directly or view it on GitHub.

@KranthiKishore
Copy link

Am getting Aws::S3::Errors::InvalidArgument: Argument format not recognized error when uploading file if I give grant_read option. Can you tell me why is this?

irb(main):084:0> object => #<Aws::S3::Object bucket_name="test_development", key="test_sample_file.csv"> irb(main):085:0> object.upload_file('/home/kranthi/projects/hubkit/example_output.csv', grant_read: 'test_sample_file.csv') Aws::S3::Errors::InvalidArgument: Argument format not recognized

@trevorrowe
Copy link
Member

@KranthiKishore the grant_read option expects a value formatted to match the 'x-amz-grant-read' header. You can reference the Amazon S3 api docs for more information on the expected format. That said, it looks like what you really want is to make the object publicly readable. You can do this using the 'public-read' canned acl:

Try the following:

object.upload_file('/home/kranthi/projects/hubkit/example_output.csv', acl: 'public-read')

@fatuhoku
Copy link

fatuhoku commented Mar 8, 2017

What's the syntax then? Currently I've got:

    obj.put(file_name, contents, {}, "authenticated-read")

@srchase srchase added the guidance Question that needs advice or information. label Dec 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

5 participants