Sha256: a8abc50c0976510955aaca86e44782c1ee7e4368b1f33db8cba0e534f6600c5e
Contents?: true
Size: 665 Bytes
Versions: 17
Compression:
Stored size: 665 Bytes
Contents
class AttachmentsController < AlchemyController # 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
Version data entries
17 entries across 17 versions & 1 rubygems