views:

175

answers:

3

I would like users of my ruby on rails app to be able to upload documents (Word Documents, Spreadsheets, PDFs, etc). What is the best way of doing this?

+1  A: 

"Best" depends on your exact needs, but have a look at PaperClip. It's a pretty easy way to integrate files with ActiveRecord.

Chuck
+5  A: 

I've used file_column, attachment_fu, and paperclip. I've also had to dive into the source on all three plugins.

Without a doubt, I recommend paperclip above the others. The source is easier to read and understand. Its easier to extend. It doesn't do extraneous file copies.

Go with paperclip and let us know if you have any questions.

Jonathan R. Wallace
A: 

I agree that Paperclip is the best solution currently available.

If you decide to use Paperclip, you might want to take a look at this question which discusses how to display thumbnails for non-image types (.doc, .xls etc).

http://stackoverflow.com/questions/851226/set-path-for-original-images-using-paperclip-in-rails

Olly