修復ie下載中文亂碼

This commit is contained in:
chiu committed 2023-05-19 21:05:12 +08:00
1 parent dee431eedf
commit 151748bcb8
1 file changed
+3 -1
+3 -1
View File
@@ -665,7 +665,9 @@ class AnnouncementsController < ApplicationController
render "archives/redirect_to_file.html",:layout=>false
return
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)
return
end
end