|
|
|
@ -18,9 +18,9 @@ class AttachmentsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
pdf_attachment = params[:disposition] || "attachment"
|
|
|
|
|
if pdf_attachment == "inline"
|
|
|
|
|
send_file absolute_path(local_path(@file)),filename: @file.filename, disposition: 'inline',type: 'application/pdf'
|
|
|
|
|
send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: 'application/pdf'
|
|
|
|
|
else
|
|
|
|
|
send_file(absolute_path(local_path(@file)), filename: @file.filename,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
|
|
|
|
|
update_downloads(@file)
|
|
|
|
|
end
|
|
|
|
|