Created
February 25, 2009 18:27
-
-
Save christopherslee/70334 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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