I would have to compress all files within a specific folder. Does anyone know how I can do this from within Navision C/SIDE. May be there is some kind of OCX or Automation Server I can use. I thought of using pkzip in a SHELL-command, but isn't there a better solution?
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
0
Comments
A DLL of this compression library can be found at http://www.winimage.com/zLibDll/
I did not try this, but maybe you can call this DLL from C/AL code.
Can you help me with this?
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Some C/AL code:
where x is a OCX-variabele, pointing to "zlibIF Class".
I was looking too for some OCX-possibilities, and one I found:http://www.freedownloadscenter.com/Programming/Visual_Basic_Components_H-P/Maquisistem_Zip_Compress_OCX.html. Now, this always shows a Pop-up, and it didn't seem to work properly (I always got an error 'bad file name' or something).
Now, I'm trying your possibility, but here, it seems that I only can compress 1 file to 1 zip-file. Now, my main intention was compressing a folder to one file (because, later on, I have to e-mail this file).
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Now, this has as major disadvantage that it is a DOS-routine, which means, that it can't use the long Windows-names. E.g. "Waldos zip file.html" becomes something like "waldos~1.HTM". Also the zip-file itself can't have a long file-name. So, if possible, I would prefer another solution.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
I found a better pkzip now at http://burks.brighton.ac.uk/burks/software/compress/install.sw?3.cutezip2.exe. It's not pkzip, but pkzipc and works slightly different. Here is my code:
Thanks for the help!
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
You can find 'Microsoft Shell Controls And Automation' in all Microsoft Windows computer from W95. \:D/
After this, copy files from downloaded file: zipfldr.dll,dunzip32.dll and dzip32.dll into Windows\System or Windows\System32 (depends on OS) directory and register zipfldr.dll with regserv:
regserv32 X:\windows\system32\zipfldr.dll
Should work:)
Thanks for the way described.
Maybe somebody tried using CAB?:)
When testing Albertos code example above I'm getting an error: "An exception occurred from an external component."
What am I doing wrong?
Specifically the error occours when executing the "DstFolder:=Shell32.NameSpace(ZipFileName);" statement - I'm guessing because ZipFileName points to a file and not a folder?
Besides this I'd like to know which modifications I have to make in the code in order to be able to compress (and de-compress) single files?
Thanks in advance!
About working with seperate files, it's the same as working with standart folders. F.e. you can define Folder.CopyHere(filename) and so on.
I'm on WinXP.
I don't know if ZIP folders functionality is enabled or disabled - is this configurable? I was hoping to write code that would be executable on any WinXP machine.
If I understand you correct, is legal?
You can re-enable it by running (if it is turned off):
regsvr32 zipfldr.dll
Not exactly, use like this: Hope it helps
The error occours when executing:
If I replace 'c:\myzipfolder.zip' with 'c:\myzipfolder' (and create the folder beforehand) I get no error, but obviously no zipfile either
Maybe the zipfolder-functionality isn't completely enabled since it looks like windows won't recognize the zipfile as a folder??? - or maybe there is another way to make windows recognize the zipfile as a folder??
Can You view files in zip folder using explorer? Put one zip file to disk c, open explorer and on left treebar you must see it (folder with zigzag).
It seems that registrering zipfldr.dll requires re-boot in order to take effect
It works now, but I think I have to solve this using a different approach - registrering the dll from navision is ok, but booting the machine, I think not...
I think I'll be going with ZlibOCX2.dll which I can export and register when I need it.
Btw. do you know how well the compression within BLOB-fields work?
In my case rebooting pc is not a problem Also I don't like licensing problems with such OCXes, no support and so on
About BLOB's - actually have no idea Till now
Thanks in advance!
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
have anyone a solution to make a GZIP (Not ZIP) File ?
The GZIP dll and the GZIP OCX from Page 1 doesn work in my case.
Any Ideas ?
Thx & Greetz
CBT
I (like many before) have to zip a bunch of files then email them to a customer .
I have read many strings on the subject and the blow code (kind of) works for me
but im an inquisitive so and so... therefore i have a few questions and would like to take the process to another level of complexity
first my questions
1.What is the relevance of
IntegerValue:=101010256;
2.Whats the point of the loop?
FOR i:=1 TO 9 DO
Now for the complexity
If (as i suspect) the loop is simply a filler of time to allow for the zip process to work, then how would I develop the code to allow for a variable number of files. For example I am trying to compress our Proof Of Delivery .tif files per customer and Email them to the customer. One customer folder might contain 1800 documents the next may only hold 1. so putting a static loop of 9 may delay the process where it doesnt need to be delayed.
A further complexity issue relates to the email section of the process. Due to email poliocy, the biggest email attachment i can send is 3 Meg. So how would i split this zipping process to create a new zip file each time the file exceeds the 3MB size limit??
As always, thanks in advance
M@
I have seen the future and it's egg shaped.
this is an old story.. hope u fixed it.. if not hope this will help u
http://www.mibuso.com/dlinfo.asp?FileID=1445
Hi,
URL given above is dependent on 3rd party tool. Instead of that with the existing 'Microsoft Shell Controls And Automation' is it possible to use Password?
Thanks in advance.
Regards,
Sanjeev
hope it helps