Hi Sergio,

It looks like you're using Paperclip, based on the "file_name_name"
and "file_content_type" etc., attributes? Is this right? I'm not
sure... if you're not, you should try Paperclip.

I wrote an extension to Paperclip to handle saving to a DB BLOB; see
http://patshaughnessy.net/paperclip-database-storage

Here's a tutorial/example on how to save a file as a BLOB:
http://patshaughnessy.net/2009/5/29/paperclip-sample-app-part-3-saving-file-attachments-in-a-database-blob-column

- pat


On Jun 17, 9:21 am, Sergio Angeletti <[email protected]>
wrote:
>                 @contact = Contact.new
>                 
> @contact.file_file_name=params[:contact][:file].original_filename
>                 
> @contact.file_content_type=params[:contact][:file].content_type.chomp
>                 @contact.file=params[:contact][:file].read
>                 @contact.save
>
> the first two elements work,
>
> @contact.file=params[:contact][:file].read results empty, can you say
> me where I am wrong.
>
> Sergio
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to