Programmable Media

Generate archives

Last updated: Dec-11-2024

You can create an archive file from assets stored in your Cloudinary storage. The generate_archive method creates an archive file that contains all the assets meeting a specified tag, public ID, or prefix (or a combination thereof). The method can be used to either return the generated archive file and/or store it as a raw asset in your Cloudinary product environment that can then be delivered like any other raw file uploaded to Cloudinary.

Important note for free accounts
By default, while you can still use this method to generate archive files, Free accounts are blocked from delivering ZIP, RAR, TAGZ, and other archive formats for security reasons.
For details, see Media delivery.

The Cloudinary SDKs wrap the generate_archive REST API method and offer the following methods:

  • create_zip: generates a ZIP file based on the specified parameter values and uploads the file to your Cloudinary product environment.
  • create_archive: generates an archive file based on the specified parameter values (default target_format = zip) and uploads the file to your Cloudinary product environment.

Instead of creating and uploading a new archive file you can generate a signed URL that expires after 1 hour. When the URL is invoked, it dynamically creates and downloads an archive file based on the given parameter values. The resulting archive file is not cached or stored in your Cloudinary product environment.

  • download_zip_url (downloadZip in Java, DownloadArchiveUrl in .NET): generates a signed URL for downloading a ZIP file based on the specified parameter values.
  • download_archive_url (downloadArchive in Java): generates a signed URL for downloading an archive file based on the specified parameter values (default target_format = zip).
  • download_folder: generates a signed URL for downloading the contents of a specified folder (and its sub-folders) and includes all assets from the requested folder regardless of resource_type.

For complete details on all available options and parameters, see the generate_archive reference.

For example, to create a zip file that contains all images that have the shirt tag:

✔️ Feedback sent!

Rate this page: