diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index a668a0691..8a599cb04 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -39,7 +39,7 @@ class AttachmentsController < ApplicationController value = Rails.cache.read(cache_key) if value.to_i >= 5 && File.exist?(tmp_path) filepath, ref = url.split("/")[-1].split("?") - send_data(tmp_path, filename: filepath, stream:false, type: 'application/octet-stream') + send_file(tmp_path, filename: filepath, stream:false, type: 'application/octet-stream') else if url.starts_with?(base_url) && !url.starts_with?("#{base_url}/repo") domain = GiteaService.gitea_config[:domain]