diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index e0dd71467..0bfe9f124 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -17,9 +17,12 @@ class AttachmentsController < ApplicationController redirect_to @file.cloud_url and return end - pdf_attachment = params[:disposition] || "attachment" - if pdf_attachment == "inline" + type_attachment = params[:disposition] || "attachment" + if type_attachment == "inline" 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, disposition: 'inline',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