nathancolgate / s3-swf-upload-plugin

A rails 3 gem which allow user upload files to S3 through an embedded flash directly. All UI has been moved out of flex and can be controlled by CSS and JavaScript callbacks.
http://www.nathancolgate.com
MIT License
317 stars 74 forks source link

Switching the 'Content-Disposition' to 'inline' cause a 403 error with Amazon. #22

Closed abelmartin closed 12 years ago

abelmartin commented 13 years ago

Hi Nathan,

When left to it default setting in the S3UploadsController (line 30):

{'Content-Disposition': 'attachment'},

...uploads happen without a problem. If I switch to:

{'Content-Disposition': 'inline'},

...or remove the line completely in the hopes that by default my upload will be 'inline', Amazon returns with following error:

Amazon S3 returned an error: HTTP status 403.

Do I need to change something else in the controller?

Thanks, Abel.

cracell commented 13 years ago

I'm having this same issue. Not sure why the 403 is being returned.

Edit: Looking through the source I see line 183 of flex_src/src/com/elctech/S3UploadRequest.as says

"postVariables["Content-Disposition"] = "attachment";"

rather than loading from options like everything else there. I'm not very familiar with Flex but seems like a bug.

mixonic commented 13 years ago

I think I'm running to this same error. Changing the content disposition to inline in app/controllers/s3_uploads_controller.rb just results in an error.

So close to having a great, quick image attachment/upload solution!

kungpoo commented 13 years ago

Similar issue here https://github.com/nathancolgate/s3-swf-upload-plugin/issues#issue/29/comment/717840

00hello commented 12 years ago

Has anyone come up with fork with this feature. I agree with mixonic. It would be perfect if it weren't for having to have {'Content-Disposition': 'attachment'}

nathancolgate commented 12 years ago

Thanks to @JKillian: https://github.com/nathancolgate/s3-swf-upload-plugin/pull/76