PaperClip: An Alternative Attachment / File Upload Plugin for Rails

3 Comments
By Peter Cooper on November 10th, 2008 in Plugins

redpaperclip.png In Goodbye attachment_fu, hello Paperclip, The Web Fellas present a walkthrough of Paperclip, a new(ish) Rails plugin that makes file (and particularly image) uploads easy. It's well worth a read, especially if you're just starting to develop a new app and are looking at which file upload technique to go with.

Paperclip is compelling firstly because it's developed by thoughbot, a team of ridiculously talented Rails developers who've released a lot of awesome Rails-related projects (such as Shoulda, Factory Girl, and Jester). Secondly, it offers some awesome features: no extra database tables needed to refer to files/attachments, only one library required for image processing (ImageMagick), and a very easy way to refer to files (as attributes on the main model, basically).

The official documentation is here, but Jim Neath has also written a full Paperclip tutorial that will take you from start to finish.

Supported by Media72 Hosting: Looking for reliable UK Ruby on Rails hosting? Packages start from just £7/month on our mod_rails/apache stack hosted on fast UK servers and include free 24/7 support.

3 Responses to “PaperClip: An Alternative Attachment / File Upload Plugin for Rails”

  1. Timothy Johnson Says:

    I've been using Paperclip as my default for over a year now, and I can tell you it is well worth it. I have even switched old applications over from A-fu to using Paperclip because of its simplicity and utility.

    For everyone who asks the question: How do you have many attachments to a model like Attachment-fu does? Well easily enough you can make a separate Model with a has_many relationship (like A-fu does by default) and define your Paperclip attachment there, instead of in the model directly. I find this to be the win, that I can just define a has_one attachment directly in the model, or break it out into its own class with all the attributes it needs.

  2. Akhil Bansal Says:

    Hi,

    I have used paper clip too, for one of my project. Its worth using it if you don't have much image handelling. :)

  3. Jose HG Says:

    I've tried PaperClip but I can't say goodbye to A-fu.

    PaperClip doesn't work as reliably as A-fu with files other than images.

    I need to upload PDF and Word docs, just to name a couple. PaperClip crashes with PDFs.

    So for handling a wide-range of file formats and dependable performance, A-fu is still the way to go for me.

Leave a Reply