Sha256: b67ebafcc73216ed48182ba1dd3cfd15b3a1d9609f331ce0877b42a9f4913a73
Contents?: true
Size: 658 Bytes
Versions: 21
Compression:
Stored size: 658 Bytes
Contents
module Alchemy class AttachmentsController < Alchemy::BaseController # sends file inline. i.e. for viewing pdfs/movies in browser def show @attachment = Attachment.find(params[:id]) send_file( @attachment.public_filename, { :name => @attachment.filename, :type => @attachment.content_type, :disposition => 'inline' } ) end # sends file as attachment. aka download def download @attachment = Attachment.find(params[:id]) send_file( @attachment.full_filename, { :name => @attachment.filename, :type => @attachment.content_type, :disposition => 'attachment' } ) end end end
Version data entries
21 entries across 21 versions & 1 rubygems