EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Unpack GZIP string to a file

Posted: 04/01/2016 14:28:28
by Eduardo Helminsky (Standard support level)
Joined: 08/20/2010
Posts: 112


I am trying to figure out how to unpak a string in GZIP format to a file.

1) I have received an string from a webservice in Base64 format.
2) I convert this string using MimeDecodeString
3) Then the code unpak but how the component knows that it is in GZip format ?

procedure ExtractGZip(cZip: String; cPath: String);
var xZip: TElZipReader;
xStr: TStringStream;
cZip := MimeDecodeString(cZip);
xStr := TStringStream.Create;
xZip := TElZipReader.Create(nil);

I do not know if I am doing the right thing.

Posted: 04/01/2016 17:24:39
by Ken Ivanov (Team)

Hi Eduardo,

Thank you for contacting us.

Typically ZIP/GZip streams have special headers that let the processing application identify that the stream contains data of the appropriate type.

Could you please let me know what exactly you are trying to do? Do you want to check whether the decoded data are valid ZIP/GZip data before passing it to e.g. TElZipReader?

Posted: 04/02/2016 06:15:59
by Eugene Mayevski (Team)

Actually GZip stream can not be handled with TElZIPReader component.

In SecureBlackbox 14 we have TElGZIPReader component, which can handle GZIP.

Sincerely yours
Eugene Mayevski
Posted: 04/04/2016 13:07:20
by Eduardo Helminsky (Standard support level)
Joined: 08/20/2010
Posts: 112

Thanks Ken and Eugene for the answers.

It was my mistake because I was reading the help from version 12 and what I need is TElGZipReader. I will use this and come back if needed.

Thanks again.



Topic viewed 2286 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!