diff --git a/apps/dashboard/app/controllers/files_controller.rb b/apps/dashboard/app/controllers/files_controller.rb index 3875b73321..0e297551fa 100644 --- a/apps/dashboard/app/controllers/files_controller.rb +++ b/apps/dashboard/app/controllers/files_controller.rb @@ -52,9 +52,7 @@ def fs end if can_download - zipname = "#{@path.basename.to_s.gsub('"', '\"')}.zip" - response.set_header 'Content-Disposition', "attachment; filename=\"#{zipname}\"" - response.set_header 'Content-Type', 'application/zip' + zipname = "#{@path.basename}.zip" response.set_header 'Last-Modified', Time.now.httpdate response.sending_file = true response.cache_control[:public] ||= false @@ -62,7 +60,7 @@ def fs zip_headers = ZipKit::OutputEnumerator.new.streaming_http_headers response.headers.merge!(zip_headers) - send_stream(filename: zipname) do |stream| + send_stream(filename: zipname, disposition: 'attachment', type: :zip) do |stream| ZipKit::Streamer.open(stream) do |zip| @path.files_to_zip.each do |file| next unless File.readable?(file.realpath)