GLIDEZIPUTIL

rohanhd
Kilo Contributor

Hi All,

I need to un gzip the attachment which has an image. I have got the attachment from the sys_attachment_doc table in 4k chunks. Ordered by position, base64 decoded the chunks and added them together to get a gzip version. I can also do this via the attachment API. Again I will get gzip version.

To unzip I wanted to use GlideZIPUTIL ZIP_UNZIPPING function. when I explore it using following

or (var i in GlideZipUtil) {

      gs.print(i);

}

I get

*** Script: addEntry

*** Script: CHARSET

*** Script: UTF_8

*** Script: _8859

*** Script: _8859_1

*** Script: ZIP_UNZIPPING

*** Script: WINDOWS_1252

*** Script: ZIP_WRITTEN

*** Script: ISO_8859_1

*** Script: ZIP_ZIPPING

But when I try accessing ZIP_UNZIPPING it gives me error

Attempted script access to inaccessible member denied - com.glide.util.ZipUtil:ZIP_UNZIPPING:

Evaluator: java.lang.SecurityException: Illegal access to field ZIP_UNZIPPING in class com.glide.util.ZipUtil

  Caused by error in script at line 21

  18: }

  19:

  20: this.ZipUtil = new GlideZipUtil();

==> 21: var img = ZipUtil.ZIP_UNZIPPING(base); //won't let me access ZIP_UNZIPPING

  22:

  23: quote = quote + "<tr><td >"+ img +"</td></tr>" //trying to print image

  24:

17 REPLIES 17

austinbuono
ServiceNow Employee
ServiceNow Employee

its istanbul-09-23-2016__patch10b-12-07-2017_12-18-2017_1521 . and the file zipped is xls.  

Dev is saying: The method GlideZipUtil().unzip(file outputDir, InputStream fis); is already GlideScriptable. Are we not able to use this method to unzip the file?

Guess I am just confused on how to use it now.  Let me know if you have any suggestion.  In the meantime i will keep plugging.

Thanks!

I tried on the same build. kingston was personal. It works fine. Single record loaded via excel and xls. 

 

You can try by creating a sample table yourself and loading the file. Also I would reduce the length of the filename. There used to be a bug where too long fiule names case issues.

 

Below is a test I did on Istanbul same patch and it has loaded correctly.

 

find_real_file.png

austinbuono
ServiceNow Employee
ServiceNow Employee

Sorry for the delay you are correct!  The file they provided in the zip was corrupted.