New to Rails 3? Check out the Ruby on Rails 3 Tutorial book and screencast.

A book and screencast series showing you how to develop and deploy industrial-strength Rails apps in a direct, step by step way. The screencast series includes 12 lessons over more than 15 hours! Get the best "over the shoulder" experience of following what a top Rails 3 developer does when building an app today. Click here to learn more.

PaperClip: An Alternative Attachment / File Upload Plugin for Rails

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.

Post to Twitter Tweet This Post

Vaguely Related Posts (Usually)

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

  1. #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. #2
    Akhil Bansal Says:


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

  3. #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.

  4. #4
    Povess Says:

    Yeah Paperclip is cool if you need a quick uploader tool. I'm building an app now that transcodes video files and a lot of other stuff - thumbnails, screen grabs, transfer the files to a CDN, etc. after upload. I thought Paperclip would be cool because the processors in Paperclip give you a place to do that but it's a freaking pain. I've ended up writing my own methods in my models to deal with all the functionality I need. Things like deleting the files, thumbnailing, naming, etc. Yeah it may remove the file attachment but leaves folders and the others files I create on upload. So almost all the benefits of it have been lost. I'm in process of just creating my own file management methods too. So once that's done goodbye paperclip. But I still would use it for quick image uploads. I do recommend it for that. The problem I see is that there a lot of cool plugins out there that get you going quick, but when you really look at the real functionality you need - upload a file, move it to a directory, and name you really need a plugin?

  5. #5
    Dragonfly: Image Handling For Champions Says:

    [...] – another one?!”.. I hear you exclaim. While using Dragonfly in Rails is similar to using, say, Paperclip, a significant difference is that images are generated on the fly, as opposed to when uploaded. [...]

Leave a Reply