视频拖拽问题

dev_video
daiao 5 years ago
parent e5ec1af383
commit 49d93fb6aa

@ -22,7 +22,8 @@ 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, disposition: 'inline', type: @file.content_type.presence || 'application/octet-stream'
send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',
type: @file.content_type.presence || 'application/octet-stream', x_sendfile: true
else
send_file(absolute_path(local_path(@file)), filename: @file.title,stream:false, type: @file.content_type.presence || 'application/octet-stream')
end

Loading…
Cancel
Save