|
|
|
@ -18,8 +18,7 @@ class AttachmentsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
pdf_attachment = params[:disposition] || "attachment"
|
|
|
|
|
if pdf_attachment == "inline"
|
|
|
|
|
send_data absolute_path(local_path(@file)),filename: @file.filename, disposition: 'inline',type: 'application/pdf'
|
|
|
|
|
# render pdf: absolute_path(local_path(@file)), filename: @file.filename, disposition: 'inline', type: @file.content_type.presence || 'application/octet-stream'
|
|
|
|
|
send_file absolute_path(local_path(@file)),filename: @file.filename, 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')
|
|
|
|
|
end
|
|
|
|
|