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

xlsx content-type is wrong #164

Closed
farrokhpey opened this issue May 31, 2020 · 3 comments
Closed

xlsx content-type is wrong #164

farrokhpey opened this issue May 31, 2020 · 3 comments

Comments

@farrokhpey
Copy link

I'm using carrierwave-aws and mimemagic latest version, now when upload a xlsx file in s3 everything is OK and file will be uploaded to s3, but when i try to download it, a zip file startdownloading, as i know the content type of file may be wrong,
now could you please tell me how can i set correct mime type for xlsx file while uploading using CarrierWave::Uploader::Base config

@sorentwo
Copy link
Contributor

sorentwo commented Jun 1, 2020

Setting the mime type isn't handled by carrierwave-aws at all. Take a look at the official wiki for a list of plugins that may help you out https://github.com/carrierwaveuploader/carrierwave/wiki

@sorentwo sorentwo closed this as completed Jun 1, 2020
@farrokhpey
Copy link
Author

But I need more help, I saw your link but I don't know how should I use them,
I'm new to Ruby
I need to use carrierwacw-aws and I'm uploading xlsx files, but it seems their mimetype are wrong.
now I decide to set miimetyoe manually but I need your help because I don't know how.

@sorentwo
Copy link
Contributor

sorentwo commented Jun 1, 2020

Setting the content type is handled by carrierwave itself, not carrierwave-aws. The content_type is set from the file that you upload. I believe you can override it directly in your uploader or on the file, but I'm not 100% sure. You'll need to ask on the carrierwave project (which I don't maintain).

In fact, there is an issue there about this exact problem: carrierwaveuploader/carrierwave#1995

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