Compress multiple jpeg images into one zip file

What are you trying to achieve?

I would like to create a zip file containing multiple images.

Steps taken so far

I set the webhook that imports the record, then I inserted an Iterator module to process all the images in that field, I inserted an HTTP Get a File module. After that I inserted an Array Aggregator module. After this module I inserted Archive to create the zip file. Finally I inserted a dropbox module to upload the file to dropbox.
For this test the “Foto Sopralluogo” field of Airtable (attachment type), contains 2 photos. With this configuration, in the dropbox I find 2 zip files each containing a photo.
I’ve been trying to solve this problem for 2 days and I would like to thank anyone who can find the time to help me.

Screenshots: scenario setup, module configuration, errors







I’ve not tested it, but here’s my first thoughts …

  • The Create an archive module is (I think) itself an aggregator. It expects individual files that you’re adding to an archive - not an array of files.
  • That means you don’t need the Array Aggregator at all
  • The Source Module for the Create an archive module should be the Iterator (the source for any aggregator should be the module that’s generating the individual bundles that you want to aggregate)

Although the ZIP archive is a convenient way to package up files into a single file, for files that are already highly compressed (like JPEGs) you’re unlikely to get any further compression. If the usability of having a single file is important then that makes sense - but otherwise you’re using Make operations and data allowances for something that’s not gaining any more compression.

2 Likes

Spectacular! Thank you so much! With your solution I solved it right away. Super!

2 Likes

Welcome to the Make community!

Does the Module Require You to Map File Data?

Did you forget to download the file using the file’s link/URL? If it’s not downloaded to the scenario, the next module can’t access the file binary data (contents).

To do this, you can use the HTTPGet a File” module with the file URL that you need to download. Your file has to be publicly accessible on the internet (doesn’t require authentication).

More Than One File?

If you have an Array of multiple file URLs, you can use an Iterator module, and map the resulting bundle value/URL to the “Get a file” module.

To download multiple files before proceeding to the next module, you can use an Array Aggregator.

Combining Bundles Using Aggregators

Every result (item/record) from trigger/iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.

You can find out more about the other types of aggregator modules here:

Question: Which is the best aggregator do you think you’ll need for your use-case?

For more information, do view these similar questions previously asked by other community members, which may answer your question:

Do try to search this forum first for existing answers. This may help you get to the solution faster, and also help keep the forum organised. Thanks for your cooperation!

Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

@samliew