Download all images or create a zip file of all downloads from gallery downloads

I am on a photo-sharing site and I want to provide functionality to upload all the images available in the gallery. I took the gallery with respect to where I can get all iamges at @ gallery.uploads,

Now I want to download all the files or, if possible, create any zip file so that we can download this file with downloads inside the gallery,

thank

+3
source share
1 answer

Use rubyzip gem to create server side zip files:

   require 'zip/zip'

   Zip::ZipFile.open("my.zip", Zip::ZipFile::CREATE) {
    |zipfile|
    puts zipfile.read("first.txt")
    zipfile.remove("first.txt")
   }

zip sendfile rails . Zip::Zipfile sendfile .

+7

Source: https://habr.com/ru/post/1735903/


All Articles