Reputation: 5085
I need to add the ability to upload and store any kind of file, PDF, XLS, DOC, etc. What is the best way to do this in a ruby on rails application?
Upvotes: 1
Views: 1411
Reputation: 1391
I've worked with two of the big players when it comes to file uploads. carrierwave and paperclip.
They provide a good solution for a common task with support for different storage alternatives. Both support filesystem and S3. Carrierwave also supports Rackspace Cloud Files and MongoDB’s GridFS.
I would recommend carrierwave because of one aspect where they are different to use. It uses a separate upload class that you mount on your model. This separates your code related to the file upload from the model code. I find this approach cleaner and easier to test.
Upvotes: 0
Reputation: 1073
I'd recommend you to use paperclip or carrierwave both are really good libs and work out of the box in most cases.
Upvotes: 4