Hi,
how to apply code to decode Base64 Zip File in Blob Field and extract the File from Zip Folder in NAV2009Classic Client. Now with existing code it works fine when attachment in XML file is PDF, it is properly encoded and write the file details in Blob field and read (decode) in Navision. But when it is Zip File, it throws error while decoding like below.
Answers
https://dynamics.is/?p=275
Base64 decoding:
Automation = 'CG Request Client'.Base64
obtain it installing commerce gateway from nav installation
IF ISCLEAR(XMLNode) THEN
ERROR(Text001);
IF ISCLEAR(Base64) THEN
CREATE(Base64);
Bestand.CREATETEMPFILE;
FileName := Bestand.NAME;
Bestand.CLOSE;
Base64.Decode(FileName,XMLNode);
CLEAR(TempBlob);
TempBlob.Blob.CREATEOUTSTREAM(Outs);
Bestand.OPEN(FileName);
Bestand.CREATEINSTREAM(Ins);
COPYSTREAM(Outs,Ins);
Bestand.CLOSE;
ERASE(FileName);
Thanks for your kind suggestion. But that does not works as expected,again same error. is popping up.
So save it without extension, and unzip it with the unzip code in my link