Can I bulk download images as a ZIP file?

Follow

Comments

20 comments

  • Avatar
    oleg moseyko

    how to download images whith JS

    0
    Comment actions Permalink
  • Avatar
    Stadri Emblems

    Hi Itay,

    I'm using Cloudinary to upload PDF and I can do it successfully. Everything works and I can download them individually. However, when I try this method you mentioned above to obtain my PDF files inside a zip file I get an error "No images found for multi pdf_upload". I'm using Django.

    When I upload the PDF I get this response:

    {"secure_url": "https://res.cloudinary.com/my-account/raw/upload/v1385505701/order_56_20131126.pdf.pdf", "public_id": "order_56_20131126.pdf.pdf", "tags": ["20131126", "pdf_upload"], "url": "http://res.cloudinary.com/my-account/raw/upload/v1385505701/order_56_20131126.pdf.pdf", "created_at": "2013-11-26T22:29:44Z", "bytes": 95410, "version": 1385505701, "signature": "6f10221667fe19b976f8a735793c56f3f0b1c271", "type": "upload", "resource_type": "raw"}

    So, I know that my PDF files are tagged and uploaded properly.

    So, my question is does Cloudinary support multiple PDF downloads by tag or is it just images it can zip?

    The code I'm using is straight forward:

    from cloudinary import uploader

    uploader.multi("pdf_upload", format="zip")

    Cheers,

    Mario

     

    0
    Comment actions Permalink
  • Avatar
    Itay Taragano

    It seems like your PDF was uploaded as a 'raw' file instead of the default 'image' resource_type. Please upload PDFs in standard resource_type (default: 'image'). This will allow you to both generate a ZIP file and generate thumbnails from PDFs to image types (e.g., JPG, PNG, etc.).

    0
    Comment actions Permalink
  • Avatar
    System Administration

    Hi,

    There seems to be a limit to the size of the zip file (30MB). Can this be increased? We have more than 30MB of files (with the same tag).

    Is there a way to specify image dates or a range to zip so that I can download my content in chunks.

    Atif

    0
    Comment actions Permalink
  • Avatar
    Nicholas Friend

    Hi Guys, is there a way to download a zip file of images, based on an array of URL's?

    0
    Comment actions Permalink
  • Avatar
    Itay Taragano

    Currently ZIP files can be generated based on images sharing a certain tag only. 

    You can write a short script which goes through your images and tag them, for example:

    Cloudinary::Uploader.add_tag('temp_tag', ['image1', 'image2'])

    Then generate the ZIP as demonstrated in the Forum, and afterwards you can remove the tag from the images, for example:

    Cloudinary::Uploader.remove_tag('temp_tag', ['image1', 'image2'])

    0
    Comment actions Permalink
  • Avatar
    Christian Fehrlin

    Hi, is there any way to use this API through javascript?

    I couldn't find any information as to how that's possible nor did I find anything in the cloudinary_js source code...

    In the backend we're using java (we're already using a service to sign uploads), but even in the java docs I couldn't find any mention of this feature...

    0
    Comment actions Permalink
  • Avatar
    Jeremy Kallman

    This feature is great! But is there further documentation available? For example, how do we know when the ZIP file is created and present? Is there a callback of some kind? And also, what happens if you exceed the 500 file limit?

    Thanks in advance!

    0
    Comment actions Permalink
  • Avatar
    Bartosz Tomczak

    i used this https://github.com/qLb/downloadcloudinaryimages, it doesn't zip but downloads all images from the platform. Nice and almost easy :)

    0
    Comment actions Permalink
  • Avatar
    Ajit Singh

    HI, Itay

    i am not able to download video with bulk resource downloading using multi, even i'm not able to tag video resource

    var tagParams_Add = new TagParams()
    {
    PublicIds = PublicIds,
    Command = TagCommand.Add,
    Tag = tag
    };
    m_cloudinary.Tag(tagParams_Add);

    its not adding tag to video resource. if i manually tag the video , multi method is not downloading the video

    0
    Comment actions Permalink
  • Avatar
    Alex Caldas

    Hi Itay,

    In order to tag all uploaded images, could you please share a C# code on how to list all uploaded images and extract the folder they are in?

    I plan to tag them based on the folder, share a code snippet on how to tag them as well.

    Once they are tagged, I know how to create a zip based on a tag with a transformation.

    Thanks!

    0
    Comment actions Permalink
  • Avatar
    Nadav Ofir

    Ajit, try to set the `resource_type` parameter to video in both tag() and multi() APIs. If this doesn't help, please contact us with more details and we'll be happy to help further.

    0
    Comment actions Permalink
  • Avatar
    Nadav Ofir

    Alex, while this API is still available and can serve you as you described, a better practice will be to use the new generate_archive API which allows you to assemble an archive based on resource prefixes (e.g. folders hierarchy).

    0
    Comment actions Permalink
  • Avatar
    Alex Caldas

    Hi Nadav, I'm working with C# and according to you the generate_archive API is not yet supported in .net, so I'm using the Multi API, see code below, to get a zip file with a transformation based on a tag.

    However, I need to loop thru all the uploaded images and tag them based on the folder they are in, could you please share C# code to accomplish this task?

    Cloudinary cloudinary = new Cloudinary(account);
    Transformation transform = new Transformation();

    transform.Height(100);
    transform.Crop("scale");

    MultiParams parameters = new MultiParams("kiss");

    parameters.Format = "zip";
    parameters.Transformation = transform;

    MultiResult result = cloudinary.Multi(parameters);

    if (result.Uri != null)
    {
    string url = result.Uri.ToString();
    Response.Write("" + url + "");
    }

    0
    Comment actions Permalink
  • Avatar
    Nadav Ofir

    Hi Alex, for this purpose you can use something like:
    1. List all of your resources using the listResources() method.
    Here's an example from the git repo: https://github.com/cloudinary/CloudinaryDotNet/blob/master/Cloudinary.Test/CloudinaryTest.cs#L800
    2. Iterate over the list of resources, extract the folder from its public-ids (usually requires omitting the characters which follow the last slash).
    3. Tag the resource using the extracted folder name, for example:
    https://github.com/cloudinary/CloudinaryDotNet/blob/master/Cloudinary.Test/CloudinaryTest.cs#L671

    0
    Comment actions Permalink
  • Avatar
    Alex Caldas

    Nadav, success!

    Thanks for this C# file, I has everything I need ;)

    0
    Comment actions Permalink
  • Avatar
    Ajit Singh

    there is no property called resource_type in TagParams class

    https://github.com/cloudinary/CloudinaryDotNet/blob/master/Cloudinary/Actions/TagParams.cs

    please suggest how to tag videos using dot net library

    0
    Comment actions Permalink
  • Avatar
    Nadav Ofir

    Dotnet libraries are currently going under refactoring & enhancement process. Meantime, as this is an open-source library, you can feel free to make changes to the relevant class and add missing parameters to it.
    We'll be happy to provide guidance on that topic.

    0
    Comment actions Permalink
  • Avatar
    sanjay

    can i created ZIP file from other zip file that created by generate_archive method 

    0
    Comment actions Permalink
  • Avatar
    Raz Ziv

     

    Sanjay, the answer is yes. You can create a zip archive which has a previously generated zip archive in it.

    By default, the generate_archive request is storing your archive file in your cloud as a `raw` resource.

    You can then include it in another archive, just like any other resource that you have stored on your cloud.

    When using our SDKs the create_zip() and create_archive() methods store the archive in your cloud, while download_zip_url() and download_archive_url() only return a URL for downloading a dynamically generated archive file.

    0
    Comment actions Permalink

Please sign in to leave a comment.