diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index 8055ea0..b597ab8 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -227,7 +227,9 @@ class ArchivesController < ApplicationController if (current_site.accessibility_mode rescue false) render "redirect_to_file",:layout=>false else - send_file(@path) + user_agent = request.user_agent.downcase + @escaped_file_name = user_agent.include?(/(msie|trident)/) ? CGI::escape(@filename) : @filename + send_file(@path, :type=>"application/octet-stream", :filename => @escaped_file_name, :x_sendfile=> true) end end rescue