FIX: migrate_to_s3 task not setting the right content_disposition.

This commit is contained in:
Guo Xiang Tan 2019-01-23 15:03:49 +08:00
parent 70b56c8332
commit 99cd3ff6ee

View File

@ -315,7 +315,12 @@ def migrate_to_s3
}
if !FileHelper.is_supported_image?(name)
options[:content_disposition] = %Q{attachment; filename="#{name}"}
upload = Upload.find_by(url: "/#{file}")
if upload&.original_filename
options[:content_disposition] =
%Q{attachment; filename="#{upload.original_filename}"}
end
end
if dry_run