Skip to content
New issue

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

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

Already on GitHub? # to your account

remote_#{column}_request_header is ignored? #2589

Closed
alexsmartens opened this issue Oct 7, 2021 · 1 comment
Closed

remote_#{column}_request_header is ignored? #2589

alexsmartens opened this issue Oct 7, 2021 · 1 comment

Comments

@alexsmartens
Copy link

Hi I'm using CarrierWave to host files on S3 for my project. I'm trying to host selected files with Content-Disposition: attachment header. It seems like remote_#{column}_request_header= is the way to go for setting up headers for individual files and fog_attributes would be a way to do it for all files as I'm gathering from #2006 and #2193.

Here is an example of how I'm trying to set up the request header:

class RemoteFile
  mount_uploader :file, CarrierWave::Uploader::Base
end

...
remote_file = RemoteFile.create!(name: my_file_name)
remote_file.remote_file_request_header = {"Content-Disposition" => "attachment" }
remote_file.file = my_file
remote_file.save

I can upload a file without a problem. However there is no Content-Disposition in the request header when I get the file from S3. So it seems like remote_file_request_header setter is ignored. Something does not seem right, could you please help?

@mshibuya
Copy link
Member

You're getting it wrong, remote_#{column}_request_header= is for setting headers on downloading a file using remote_#{column}_url. You need to use fog_attributes to achieve what you want.

@mshibuya mshibuya closed this as not planned Won't fix, can't repro, duplicate, stale Dec 31, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants