How to unzip a file in script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2014 09:20 AM
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,
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 05:56 AM
Hi Chris,
I think it is possible with ZipEntry and ZipInputStream java packages. Can you give more details? What will be the content of zip file?
Thanks,
CK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2014 06:18 AM
It's a single XML file inside the ZIP file. Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2014 06:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2016 01:38 PM
Did you ever find a solution for this. I have a similar interest.
Michael