【发布时间】:2020-07-06 17:53:17
【问题描述】:
我使用 ActiveStorage 将对象上传到 AWS S3。
但是上传的 S3 对象的 Content-Type 是空的。
如何设置它们的内容类型?
以下是我所做的。
@brand.compiled_css.attach(io: File.open(file_path), filename: "brand.css", content_type: "text/css")
我的 Rails 版本是 5.2,Ruby 版本是 2.6.2。
【问题讨论】:
标签: ruby-on-rails amazon-s3 rails-activestorage