Delphi ActiveX
Delphi ActiveX
Decode Base64 to Zip File
See more Base64 Examples
Shows how to decode a baes64 string that is the encoded representation of the bytes that make up a .zip archive. Decodes the base64 and writes the .zip file.Chilkat Delphi ActiveX Downloads
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;
...
procedure TForm1.Button1Click(Sender: TObject);
var
success: Integer;
b64: WideString;
zipData: TChilkatBinData;
begin
success := 0;
b64 := 'UEsDBBQA ... AAALgQAAAAA';
zipData := TChilkatBinData.Create(Self);
success := zipData.AppendEncoded(b64,'base64');
success := zipData.WriteFile('qa_output/out.zip');
if (success <> 1) then
begin
Memo1.Lines.Add('failed to write Zip file.');
Exit;
end;
end;