Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save christopherslee/70334 to your computer and use it in GitHub Desktop.
Save christopherslee/70334 to your computer and use it in GitHub Desktop.
# instead of using the "binary" type suggested by the README, use a "longblob" type (at least, in mysql)
create_table :db_files do |t|
t.column :data, :longblob
end
# to send the file in your controller
# if photo is the object using attachment_fu
def download
send_data( photo.current_data, :type => photo.content_type, :filename => photo.filename, :disposition => 'attachment' )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment