Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_video
杨树林 5 years ago
commit 0abca8aa9b

@ -22,7 +22,7 @@ class AttachmentsController < ApplicationController
send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: 'application/pdf' send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: 'application/pdf'
elsif type_attachment == "MP4" elsif type_attachment == "MP4"
response.header["Accept-Ranges"] = "bytes" response.header["Accept-Ranges"] = "bytes"
send_file absolute_path(local_path(@file)),filename: @file.title,type: @file.content_type.presence || 'application/octet-stream' send_file absolute_path(local_path(@file)),filename: @file.title,type: @file.content_type.presence || 'application/octet-stream', status: 206
else else
send_file(absolute_path(local_path(@file)), filename: @file.title,stream:false, type: @file.content_type.presence || 'application/octet-stream') send_file(absolute_path(local_path(@file)), filename: @file.title,stream:false, type: @file.content_type.presence || 'application/octet-stream')
end end

Loading…
Cancel
Save