`compress.gunzip(options)` I've been able to compr...
# suitescript
d
compress.gunzip(options)
I've been able to compress files into a zip and store it in the file cabinet. However, I'm stuck trying to unzip the files to the file cabinet. Does anyone have a sample of how to read and resave the files inside of the zip? I'm just not making any headway on this and could use some help/examples.
Copy code
let gunzippedFile = compress.gunzip({file: _f}); //'./Files.zip'
log.debug('gunzippedFile',gunzippedFile);
    
let zipContent = gunzippedFile.getContents();
log.debug('content',zipContent);

// TODO: Save zip contents to file cabinet as separate files ???
j
I might me reading into this, but the documentation for the gunzip() method makes it seem like this only works for single zipped files. https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_158584955171.html Also found this which seems to confirm it: https://stackoverflow.com/questions/68327834/n-file-how-to-unzip-file
d
Thank you @Jan Petri This is basically where I'm stuck. I was told you could but I believe you are correct, one file, not multiple. Doesn't make much sense if I can compress multiple in the
compress.createArchiver()
but I can't seem to undo that same archive file back into the original set of files I added to it.
j
Yeah, it looks like there is some functionality missing. Unfortunately I am not aware of any libraries that would do the trick here.