Sha256: f3a2c0a43a17faafae4384b4d335ba5a691e01413b99bec5537f42b01ed2749c
Contents?: true
Size: 738 Bytes
Versions: 16
Compression:
Stored size: 738 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
16 entries across 16 versions & 1 rubygems