From f2cd502b2f10def116749114e2accc62b8b8026e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 6 Feb 2020 21:48:18 +0800 Subject: [PATCH] 1 --- 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 107932cd8..a3352aaca 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -22,7 +22,7 @@ class AttachmentsController < ApplicationController send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: 'application/pdf' elsif type_attachment == "MP4" response.header["Accept-Ranges"] = "bytes" - send_file absolute_path(local_path(@file)),filename: @file.title,type: @file.content_type.presence || 'application/octet-stream', status: 206 + send_file absolute_path(local_path(@file)),filename: @file.title,type: @file.content_type.presence || 'application/octet-stream' else send_file(absolute_path(local_path(@file)), filename: @file.title,stream:false, type: @file.content_type.presence || 'application/octet-stream') end