Unzipping an attachment?

Mark Edwards3
Kilo Expert

We have a situation where an external source is providing us a zip file containing other related data files.  The requirement being that we then have ServiceNow unzip this file (stored as an attachment) and then store the contents (as attachments).

Is there any way from server-side script we can accomplish this?

We've spotted the GlideZipUtil, but can't figure out how to use it (or whether we can use it from script), so the best option we're currently looking at is to use a MID server script to pull the Zip file down to the file-system, unzip there and then push the contained files back all via REST.

Whilst that would work, it seems rather cumbersome and unnecessary when there may be an easier method within the platform itself.

 

I've had a trawl through the existing community comments, and there's really nothing of help in there (so please don't reply with the same set of external links to Stack Overflow ... we've seen them, and they're not really of much, if any help).

 

Cheers,
Mark

 

1 ACCEPTED SOLUTION

Dan Tolgyesi1
Tera Expert

Hi,

You could use a data source (System Import Sets>Data Sources) this has a "Zipped" checkbox which will unzip the attachment and load the data

Cheers

Dan

 

View solution in original post

5 REPLIES 5