Ruby On Rails gallery zip archive download - ruby-on-rails

I have a rails app that allows users to create galleries and then have people upload photos to the gallery. I was wondering what's the easiest most efficient way for users to download the gallery as a zip file with all containing pictures inside? The gallery can change anytime since users can upload pictures.
Tech wise, the app uses carrierwave and uploads the pictures to amazon S3 while being hosted on Heroku.
Any help would be appreciated.

You have to check out Rubyzip gem. Also, as your galleries change often you should to generate zip archive on the fly, I guess.

Related

Upload file in Rails 3.2 app - develop engine or use gem?

We are looking to add a simple file uploader to our rails 3.2 app which is a business application (with Rails engines). Here are what we are looking for with the file uploader:
Allow access control to who can do what. For example, sales can upload a contract and acct can view the uploaded contract.
No change to current model. The file uploader acts on its own about file uploading, checking, storing and removing. We are thinking to have a file uploader engine and attach the engine to the Rails app.
File uploaded belongs to a model. For example, uploaded contract copy belongs to a project.
May need to upload file to a remote server.
We are evaluating options of developing our own uploader engine or find a upload gem such as carrierwave or paperclip. Can someone shed a light on rails file uploading and its related issue?
Using a combination of cancan and paperclip is a good option.

Upload files on multiple server (S3, Dropbox, ...)

I'm designing a little application using Rails and I need to upload files. I searched and I found paperclip + Carrierwave to do that. I've also seen that it's possible for that gems to specify where to store the uploaded file in the model.
My question is : Using Paperclip, is it possible to know at runtime where the user wants to upload the file and of course is it possible to catch and save the file to the corresponding host ?
Regards

How should I parse a file in Ruby on Rails to store in a database?

I want to create a simple form for users to upload a file, which will be stored in a database. I also want to display all the submitted files in the database with their name and a link to download the file. Schematically, what's the best way to do this in Rails/how should I store the file in table (which fields should my table have? etc). Thanks!
i would use paperclip gem with the upload to s3 instead of file system
https://github.com/thoughtbot/paperclip
checkout the README, most of the examples are for an image, but works with non-image files as well
use paperclip to upload file, you can store images/file in your database as well as in s3 (AWS)
See below link how to use paperclip in rails with example
Here is the steps how to upload file using paperclip in rails
http://patshaughnessy.net/2009/4/30/paperclip-sample-app
for github
https://github.com/thoughtbot/paperclip
https://github.com/websymphony/Rails3-Paperclip-Uploadify

Carrierwave multi file (photo) upload

I have Ruby on Rails app and I use Carrierwave for uploading my images, but I need upload more than one image at a time. I find some jQuery plugins(uploadify, image-uplad) but I don't know how implement it to my app. I don't need a huge app/engine for it.
Check it : http://lucapette.com/rails/multiple-files-upload-with-carrierwave-and-nested_form/
Uploading multiple files at once to Rails app with Carrierwave (HTML5)

With the attachment_fu rails plugin, is there any way to delete files uploaded to Amazon S3?

Let's say I'm using attachment_fu to attach profile pics to user profiles in a system, with Amazon S3 used as the actual file storage. When users upload new profile pics, I'd like to replace the attached file with the new one. I can do this within my database (i.e. the file metadata) easily, but attachment_fu doesn't seem to provide methods for deleting the files from S3.
Am I missing something, or am I approaching this the wrong way?
Many thanks!

Resources