How can I create a ZIP file with sub-folders?


I’ve got a scenario where I need to create a ZIP file that contains sub-folders and then files within those folders. Basically, in my project I have a list of items, that each has a list of associated files. And I want to create a zip along these lines:

Zip file

  • Zip folder for Item 1
    • File 1
    • File 2
  • Zip folder for Item 2
    • File 1
    • File 2

I’ve tried “Zip File Compress and Download” and “JS Zip” which both work great for simple ZIP files with all the files in the top level, but they don’t allow sub-folders to be created.

Any ideas?


Hi Richard,

Any solution ?

Unfortunately not. In the end I just had to have all the files in the same zip file and use the name to identify what would have been the folder.