The function gzip.unzip allows to decompress a file in GZIP format.
1 gzip.unzip
Decompress the data stream indicated in the call argument.
<gzip.unzip>
<object2Stream /> !
</gzip.unzip>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Eobject2Stream | File|Blob| Byte[]|InputStream | String of bytes compressed according to the GZIP fornat from which a decompressed string is obtained. |
Returns | |
---|---|
Type | Description |
File|byte[] | Returns a temporasry file with the resulting decompression if the entry is a File or a Blob. Return a byte [] if the entry is another type. |
Example
Decompress the file [sample_gzip.gz] and store the result (the file which is obtained when unzipping) in a file called [result_gzip.txt].
Copy
<xsql-script name='zip_gzip'> <body> <!-- Decompress the file.zip and let the content in the file called x --> <file.bytes.write> <file name='C:/tmp/result_gzip.txt' type='absolute' /> <gzip.unzip> <file name='C:/tmp/sample_gzip.gz' type='absolute' /> </gzip.unzip> </file.bytes.write> </body> </xsql-script>