Need help with downloading multiple selected files/keys from S3 in ZIP

Hello everyone,

I am working on a project where I have a table containing S3 documents (and their corresponding keys). Now, I'm encountering a problem: I want to download the files from selected rows in the table as a ZIP file. Despite going through various discussions and topics on this matter, I am unable to implement it. Could someone help me step-by-step to overcome this challenge? Thank you very much in advance for your help!

1 Like

Hi @LinoPino,

This solution is still working for me: How to download multiple files from S3 and download as a zip file - #3 by Tess

Instead of calling read queries for each file like this,
img.file(query3.data.Key, query3.data.Body, {base64: true});
img.file(query5.data.Key, query5.data.Body, {base64: true});
you could have a Javascript loop that calls a S3 read query for each selected row in the table. Then, you could map over that array:

query4.data.map(x=>{
  img.file(x.Key, x.Body, {base64: true});

})