How to unzip a file in script

cborkert
Giga Contributor

An external service is sending a text file to ServiceNow, this is being received with a custom processor.

 

The file contents (HTTP POST body) text is easily read using:

var data = GlideStringUtil.getStringFromStream(g_request.getInputStream());

 

They are sending a ZIP file however, which needs to be decompressed.   Is there some script that will do this?   I've looked into ZipImportStream, but not sure how to get the bytes inflated.

 

Thanks,

5 REPLIES 5