RubyFlow The Ruby and Rails community linklog

Just released Mongoid::Paperclip - Enables file uploads with Mongoid using Paperclip.

Just released Mongoid::Paperclip for those that are interested. Quite a bunch of people have been looking around for a solution to upload files using Paperclip with the Mongoid ODM. This is my attempt to solving that problem, so here it is for anyone that’s interested.

Comments

Thanks. But please, only choose paperclip if you have to use it (for example, if you migrate a legacy app).

If you want to choose for a file uploading gem in your new app, you should really evaluate Dragonfly before Paperclip.

Dragonfly is a great Rack plugin that allows you to define the size of the thumbnails directly in the views instead of in the models. It feels so much logical to put sizes in views instead of models.

And this is a time safer : you never have to reprocess your images like in Paperclip.

https://github.com/jnicklas/carrierwave is the choice of any professional

@slainer68: Yeah because Dragonfly plays so nicely with my CDN….not!

The difference is that you can use Dragonfly to store files in GridFS, and you can’t do it with this (sweet, little) solution. Obviously you should store files in database only in special cases, but I recently found it useful for two apps we developed.

Hi guys. I actually checked out Carrierwave a long time ago. If you check the “issues” page on GitHub of that project you can see I’ve been concerned about a few issues (6 months ago or so). This still has not been resolved. Finally I decided to go back to Paperclip because I don’t see it being addressed anytime soon and to me it’s a definite show stopper.

This is the issue I submitted back then: https://github.com/jnicklas/carrierwave/issues#issue/75

Basically what it comes down to is that if you “re-upload” something over an existing file, it WON’T remove the previous one. There apparently still isn’t a good way around this. Imagine having like 10 versions of a file, then you replace that file and it makes 10 new versions and doesn’t delete the old 10. Brings you up to 20 files, do it again and you got 30 files, do it 10 more times with 50000 users on your site and well, do the math. ;)

I really hoped that these issues would’ve been solved by now but they haven’t and thus I’ll be going with Paperclip instead of Carrierwave (however I do like the Carrierwave API/DSL approach, I like it A LOT more than Paperclip’s approach, but the current issues to me are a show stopper.)

Dragonfly seems awesome to me. When it first released I tried it out but I couldn’t get it to work so I gave up and actually never re-attempted. However, from what I understand it’ll download files to the server first (from S3 for example) and then compute stuff, and then serve it and cache it. This approach is totally different from Paperclip and Carrierwave, and in some scenario’s I can see it be a better pick as well. But I don’t want to be the judge of that since I barely used it. :)

Just played around with Dragonfly, it’s really cool, but it’s extremely slow with Amazon S3. To process just 5 images it took 12 seconds. Yes, i know that after the initial request all requests afterwards are fast since it’s cached. This has it’s pros and cons. A pro would be that you only pay for amazon’s bandwidth once per file. con is that you can’t utilize their CDN and it’s extremely slow on the initial requests, this also increases the overal server load. Also I don’t know what happens when my harddisk exceeds it’s storage limit? I’d assume it’ll throw away the oldest cached files or something. Now if you are using the local file system or maybe GridFS then I could DEFINITELY see this being a great tool, and I’d most likely use it. These days though I prefer to store everything on S3 and unless someone can convince me why I should use Dragonfly + S3 I doubt I’ll do so.

That said, seriously, if you can convince me that I should use Dragonfly with S3, would be great cause I’d really like to use it. I really like how Carrierwave and Dragonfly both work in fact. It’s just all these questions or issues that pop in both of the solutions.

Yo.

There are unresolved issues in Paperclip too.

For example, the paperclip refresh task that is used to reprocess the thumbnails in your project is “still” broken on Rails 3!

Months after the release of Rails 3, I don’t think that’s normal.

I like thoughtbot gems but they only seems to push or fix bugs if they are personally impacted by them.

I agree. There really isn’t any “perfect” file attachment tool at the moment.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in