How to unzip file from sys_attachment table and store it back?

Andre5
Kilo Explorer

Hi everybody,

 

I looking for way to unzip specific file,

from zipped file in sys_attachment table and add new txt file to sys_attachment table back?

 

 Zip file contains directories and txt files. We need to get specific file from it. 

How we can do it?

 

 

Regards,

Andre. 

 

4 REPLIES 4

Jyoti8
Kilo Guru

Hi Andre,

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

Otherwise, Refer to these Links :

https://stackoverflow.com/questions/2095697/unzipping-files

https://stackoverflow.com/questions/34439147/how-to-unzip-file-on-javascript?rq=1

 

 

If my reply helps you at all, I’d really appreciate it if you click the Helpful button and if my reply is the answer you were looking for, it would be awesome if you could click both the Helpful and Accepted Solution buttons..:)

Thanks

Hello Jyoti,

 

We need solution for back end. Getting zip (file) from sys_attachment and extract one file from it`s content.

We attach zip file to CR and than we want to trigger extraction from zip file. 

Possible solution is to use GlideZipUtil.  But there is no documentation for this.

 

Regarding Data Sources, we don`t use it. We attach zip file to CR and than we want to unzip it.

 

Regarding your links,

1. for this solution you need use util package, but (from what i understand) service now removed/blocked use of packages. 

2. General limitation for this solution is that it not supported for all browser like Internet Explore: 

https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API

 

Regards,

Andre.

manasa0590
Tera Contributor

Hi Andre,

 

Is it implemented?. Could you please share the solution. I have the similar requirement to achieve. It will help. Thank you