Forum: Ruby on Rails Upload File

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Hasana H. (Guest)
on 2007-03-19 11:53
How to upload file to database for example file jpeg.
Ivor P. (Guest)
on 2007-03-19 12:27
(Received via mailing list)
Hi Hasana

Look at acts_as_attachment. I have used it and it works great. The
alternative is file_column but I struggled to get it going properly and
not find it as intuitive as acts_as_attachment.

The default behaviour is to upload the files to a directory in the
folder of your app, and store the URI of the file in the database as a
string, however, I believe you can also save the files in binary in the

If you install rmagick you will be able to do some nice stuff with
images as
you upload them, like create a thumbnail version of the image aswell.

This topic is locked and can not be replied to.