From 8d8a0414e5f0e5797a73f46027a4eed7628b4ec8 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 22 Jul 2019 20:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 2efe1df09..53a6d1ae1 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -14,7 +14,7 @@ class AttachmentsController < ApplicationController update_downloads(@file) redirect_to @file.cloud_url and return end - send_file absolute_path(local_path(@file)), type: @file.content_type.presence || 'application/octet-stream' + send_file(absolute_path(local_path(@file)), filename: @file.filename, type: @file.content_type.presence || 'application/octet-stream') update_downloads(@file) end