Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extract file on zip with folders
Message
From
11/09/2016 04:34:56
 
 
To
10/09/2016 19:52:29
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
Hyper-V
Miscellaneous
Thread ID:
01640677
Message ID:
01640689
Views:
127
>>the file's folder position is not fixed.
>>Need to cross the tree.
>>I need something similar to ADIR ()
>
>This will return .T. if a file or a folder exists somewhere in the zip file and could be extracted.
>
>
>? ExtractFileOrFolderInZipFile(m.ZipFile, m.FileOrFolderToExtract, m.TargetFolder)
>
>FUNCTION ExtractFileOrFolderInZipFile(ZipFile AS String, ToExtract AS String, Location AS String, ShellExplorer AS Object, Tree AS String)
>
>	LOCAL ShellObject  && edited
>
>	IF PCOUNT() < 4
>		m.ShellExplorer = CREATEOBJECT("Shell.Application")
>		m.Tree = ""
>	ENDIF
>
>	FOR EACH m.ShellObject IN m.ShellExplorer.NameSpace(m.ZipFile + IIF(EMPTY(m.Tree),"","\" + m.Tree)).items
>
>		IF UPPER(m.ShellObject.Name) == UPPER(m.ToExtract)
>			m.ShellExplorer.NameSpace(m.Location).CopyHere(m.ShellExplorer.NameSpace(m.ZipFile).items.Item(m.Tree + m.ToExtract))
>			RETURN .T.
>		ELSE
>			IF m.ShellObject.IsFolder AND ExtractFileOrFolderInZipFile(m.ZipFile,m.ToExtract,m.Location,m.ShellExplorer,m.Tree + m.ShellObject.Name + "\")
>				RETURN .T.
>			ENDIF
>		ENDIF
>		
>	ENDFOR
>
>	RETURN .F.
>
>ENDFUNC
>
What if I want to extract the files into ram, without passing for a file?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform