How to create a .zip file


Now I am going through the process and trying to email the .pdf file I received by zipping it into a .zip file.
However, even if I try what the community has searched for, the compression doesn’t work and the loop ends. (There are no other errors.) How do I do this?

Hi @Bobae_Lee

Please refer this post for zipping single or multiple files,

1 Like

I tried this method too, but it says it can’t find the file
Do you have a problem with me?

1 Like

Create a temporary folder(say TempFolder) to save your pdf files. Inside your for loop, use either move file or copy file activity to move your pdf files to the new location TempFolder. Now use invoke code activity and write the code “System.IO.Compression.ZipFile.CreateFromDirectory(TempFolder,ZipFilePath)”. Note that ZipFilePath and TempFolder should be “In” arguments for your invoke code activity.

This should solve your problem.

Hi @Bobae_Lee ,

Taka look at this video,

Thank you
Balamurugan.S

sorry. I don’t understand because I’m still learning.
Could you show me a sample?

Drag an invoke code activity, then follow the below screenshot:
image

Then follow this screenshot

@Bobae_Lee - Have you tried this activity? where you can simply point the as many folder(s) you want…

image

In the above example, i am zipping all the files in the folder called “Files” and zip file name is “PDFFiles”. Here is my output(since I just gave the zip name without any folder path, it got created under the project folder)