How to apply code for decode base64 Zip File and extract the XML File in NAV2009 Classic Client?.

kovaidon
Member Posts: 55
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.

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.

0
Answers
-
unzipping:
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);
0 -
Hi TallyHo,
Thanks for your kind suggestion. But that does not works as expected,again same error. is popping up.0 -
Hm.. try not to save it as a .zip file after extraction from base64.
So save it without extension, and unzip it with the unzip code in my link0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions