453
Views
9
Comments
OutSystem how to create a ZIP File for all uploaded attachment

Hi, I have one question for Outsystems. How do I ZIP my uploaded attachment files when the user done uploading their file and maybe click on a button they will be able to ZIP all the uploaded attachment into a ZIP file. The screenshot that I circle in red is the attachments that i wish to be zipped into one folder only. Hopefully there will e a guide or solution for this. Once again thank you so much.



Below the attachment is my OML File. 

Test_Function_02.oml
2024-05-08 06-29-37
Prince Aadil Khan Panwar


HI Freeman Tan,

try to use this forge component 


Gzip Compress/Decompress 


Thanks 

Prince

2024-05-08 05-59-38
Gayatri Kapadi

Hi Freeman Tan ,

Please check this link it may be useful for you to resolve the issue:

https://www.outsystems.com/forums/discussion/65749/create-zip-folders-on-export-action/

Thank you,

Gayatri

UserImage.jpg
Deemo

Yes, I know there is a lot of forge plugin i did try some of them already. But the problem is does can it ZIP uploaded attachment files into a ZIP Folder???

2024-05-08 06-29-37
Prince Aadil Khan Panwar

did you try collecting them in a list and adding into forge component action in loop?

2021-01-04 08-13-48
Toto
 
MVP

Hi @Freeman Tan ,


Do you mean doing Zip on the client side, then upload those Zip to the server side ?

If so, then you need to use javascript Zip (this is one of those javascript : https://github.com/Stuk/jszip)

2020-11-10 07-09-26
Dadi

Hi @Freeman Tan 

you can use Zip extension by Outsystem

First you need CreateZip, then use loop to iterate FileName and FileContent in your attachment table for AddFile input. After add all your file to CreatedZip, use CommitChange to update previous process, in the end use GetZipBinary to get the Zip binary for download.

If you want more than one folder, you can add prefix folder name on FileName input.

ignore prefix folder if there is no need additional folder.


Then if you already have Zip file that need to add more file, you can use LoadZip first and then use this LoadZip.ZipHandle instead CreateZip.ZipHandle for next process.


Regards

2026-02-24 21-20-41
João Elder Avelar dos Santos

Great solution. And it's already native to OutSystems. Thanks for sharing.


UserImage.jpg
Mohd Mokhtar Ahmad Badaruddin

thanks for sharing, its quite straight forward, just want to add, if using looping to add file, the Commit Changes must be outside of loop, or it will end only one file in the .zip 

2023-11-22 10-51-50
Jozy Sohail

Hi Freeman,

You can use this forge component it is very useful and its also having a proper demo to show how to use it.

https://www.outsystems.com/forge/component-overview/16326/zip-example

hope it helps.

Thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.