Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Zipping in VFP
Message
From
26/05/2006 18:24:39
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01125311
Message ID:
01125431
Views:
116
I tried Yuri's suggestion... VERY COOL and FREE! WinZip will open the files if you need to verify the results. I also noticed it compressed the subdirectories as well. I don't know if you can do single files, but if you can create a directory and compress just that directory it works great.
*To zip file

cFileZip = "C:\temp2\D401001F.ZIP"
cSource = "c:\temp1\"
strtofile(chr(0x50)+chr(0x4B)+chr(0x05)+chr(0x06)+replicate(chr(0),18),cFileZip)
o=CREATEOBJECT("shell.application")
FOR EACH ofile IN o.NameSpace(cSource).items
o.NameSpace(cFileZip).copyhere(ofile)
ENDFOR


*Unzip files 


cFileZip = "C:\temp\D401001F.ZIP"
cDestination = "c:\temp\"

o=CREATEOBJECT("shell.application")
FOR EACH ofile IN o.NameSpace(cFileZip).items
o.NameSpace(cDestination).copyhere(ofile)
ENDFOR
>I need to incorporate zipping into an app in vfp 9. I have used several things in the past, but wanted feedback on what users have done lately. It has been a while since I had to incorporate this functionality.
>
>TIA!
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform