I am using send_data to allow users to download files from the database
but ran into a small problem, it seems that files upload fine but when
they download only 64kb of the file is sent.
I’m using the basic rails code from the Agile book:
#upload code in my sheet model
self.filename = base_part_of(document_field.original_filename)
self.content_type = document_field.content_type.chomp
self.data = document_field.read
name = File.basename(file_name)
#download in my application controller
sheet = params[:id]
@sheet = Sheet.find(sheet)
send_data(@sheet.data, :type => @sheet.content_type, :filename =>
Am I just completely missing something?