How to decompress (gzip) string on the server side?

alexbin
Kilo Contributor

Hi all,

I have URL (https://..../file.csv.gs) and I have to get the file data into the string variable in my server-side script include.

I use this script to get the file data (compressed):

function _myHTTPGet(url) {

  restMessage = new sn_ws.RESTMessageV2();

  restMessage.setHttpMethod("get");

  restMessage.setEndpoint(url);

  var response = restMessage.execute();

  httpStatus = response.getStatusCode();

  return response.getBody();

}

How to decompress the data? Do SNow have support of gzip in server-side scripting?

Regards,

Alex

3 REPLIES 3

dmfranko
Kilo Guru

I don't think it has the ability OOB, but you could always bring in an external library.


alexbin
Kilo Contributor

Hi Dan,



It would be great if you recommend me the library and give code example how to use it.



Regards,


@alexbin  How did you solve this issue?

Were you able to decompress (gzip) string on the server side?

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022