diff --git a/app/controllers/assets_controller.rb b/app/controllers/assets_controller.rb index afd5742b9..635da18f4 100644 --- a/app/controllers/assets_controller.rb +++ b/app/controllers/assets_controller.rb @@ -77,7 +77,7 @@ class AssetsController < ApplicationController elsif @asset.file.is_stored_on_s3? redirect_to @asset.presigned_url, status: 307 else - send_file @asset.file.path, filename: @asset.file_file_name, + send_file @asset.file.path, filename: URI.unescape(@asset.file_file_name), type: @asset.file_content_type end end diff --git a/app/models/asset.rb b/app/models/asset.rb index eda4c9103..1492d46f6 100644 --- a/app/models/asset.rb +++ b/app/models/asset.rb @@ -241,7 +241,7 @@ class Asset < ActiveRecord::Base key: file.path[1..-1], expires_in: 30, # this response header forces object download - response_content_disposition: 'attachment; filename=' + file_file_name) + response_content_disposition: 'attachment; filename=' + URI.escape(file_file_name)) end end