Method: FileAttachmentsController#download
- Defined in:
- app/controllers/file_attachments_controller.rb
#download ⇒ Object
44 45 46 47 48 49 50 |
# File 'app/controllers/file_attachments_controller.rb', line 44 def download = FileAttachment.find(params[:id]) file_itself = File.open(.full_path, 'r') logger.debug("FILE ATTACHMENT INFO: #{file_attachment.inspect}") logger.debug("FILE INFO: #{file_itself.inspect}") send_data(file_itself.read, :filename => File.basename(file_itself.path), :stream => true, :buffer_size => 1.megabyte) end |