Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: Jim Carls
  Where is Jim Carls?
 Nashville
 Tennessee - United States
 Jim Carls
 Tags
Subject: RE: Favorite zip component
Thread ID: 209600 Message ID: 209603 # Views: 3 # Ratings: 0
Version: Visual FoxPro 9 Category: 3rd Party Software
Date: Monday, December 29, 2008 10:06:26 PM         
   


> What is your favorite or recommended approach to creating/unzipping zip files from within a VFP app? This seems like something that was probably covered somewhere here long ago, but the 60-day search window makes finding this a little harder than I wish.
>
> ...
>
> Thanks to a serendipitous click on a reply in a thread, I found that the FAQs included info about VFPCompression.fll, so I may be on the right track. However, any commentary or alternate suggestions are welcome. Thanks again...
>
> JC


Hi
These codes are from Atoufox author Mike Gagnon (october 14,2004) in this link
http://www.atoutfox.org/articles.asp?ACTION=FCONSULTER&ID=0000000190
you can zip or unzip with shell and easily with a small code.
translated it gives:
&& Zip many files -folders must exist.

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

&& Unzip
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

&& how to obtain informations on files in a zip (without unzip)

CREATE CURSOR mesfichierszip (nom c(30),type c(30),;
modidate T, systeme L, dossier L,chemin c(60),grosseur N(10))
cFileZip = "C:\temp\license.ZIP"
o=CREATEOBJECT("shell.application")
FOR EACH ofile IN o.NameSpace(cFileZip).items
INSERT INTO mesfichierszip (nom,type,modidate,;
systeme,dossier,chemin,grosseur) VALUES (oFile.Name,;
oFile.Type,oFile.ModifyDate,oFile.IsFileSystem,oFile.IsFolder,;
oFile.Path,oFile.Size)
ENDFOR
BROWSE normal


this code maybe cannot be distributed with applications (microsoft rights)
Regards

ENTIRE THREAD

Favorite zip component Posted by Jim Carls @ 12/29/2008 8:53:54 PM
RE: Favorite zip component Posted by Yuri Rubinov @ 12/29/2008 9:18:23 PM
RE: Favorite zip component Posted by Yousfi Benameur @ 12/29/2008 10:06:26 PM
RE: Favorite zip component Posted by tushar @ 12/30/2008 6:56:05 AM