From a7ab2dde23059e8d9c26386b5202adf69da3f608 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 20 Jul 2019 23:17:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=84=E4=BB=B6=E4=B8=8B=E8=BD=BD?= 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 571374468..2efe1df09 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 + send_file absolute_path(local_path(@file)), type: @file.content_type.presence || 'application/octet-stream' update_downloads(@file) end