Using Files to Zip in NodeJS

Hi,
Trying out the Files to Zip module in NodeJS, but output zip is null.

image

Have tried it two ways. First is selecting the files using the plus icon.
Second, passing an array of file paths.
In both cases, I can see from the zip.js lib module that paths are correct, but the path of files its trying to add are ending up being 0, 1, 2… etc.

How do I use this module? What is expected to be in the “Files to Add” input?
What I need is to be able to provide a list of file paths, and those files should get zipped and saved.

@patrick bump.

Hi @patrick Any chance you can provide a solution this week? A part of the app is stuck due to this.

Where are the files located that you try to zip? Do you get an error when running the server action or just an empty zip file?

Files are currently in the public folder.
No errors. Just an empty ZIP.

Here an update, unzip the file in lib/modules.

zip.zip (1.1 KB)

Working now.
Did not know about the of operator. Thanks a lot for finding time for this Patrick. :slightly_smiling_face:

It is relative new but works in all modern browsers and in nodejs. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of. Instead of iterating over keys it iterates over the values.

3 Likes

This has been fixed in Wappler 4 beta 2

This topic was automatically closed after 5 days. New replies are no longer allowed.