Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Open Zip from URL (OpenFromWeb)Open a .zip from a URL and unzip. LOCAL loZip LOCAL lnSuccess LOCAL lnFileCount LOCAL lcFileContents LOCAL loEntry LOCAL lnAddCR loZip = CreateObject('Chilkat.Zip2') * Any string unlocks the component for the 1st 30-days. lnSuccess = loZip.UnlockComponent("Anything for 30-day trial") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loZip.LastErrorText) QUIT ENDIF * Downloads a .zip into memory and opens it. lnSuccess = loZip.OpenFromWeb("http://www.chilkatsoft.com/testData/hamlet.zip") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loZip.LastErrorText) QUIT ENDIF * It can be unzipped to disk: lnFileCount = loZip.Unzip("c:/temp") IF (lnFileCount < 0) THEN =MESSAGEBOX(loZip.LastErrorText) QUIT ENDIF * Alternatively, individual entries may be unzipped into memory. * In this case, it is unzipped into a string: lnAddCR = 1 loEntry = loZip.GetEntryByName("hamlet.xml") IF (NOT (loEntry = NULL )) THEN * If the file has bare LF line endings, add the CR to get * CRLF line endings. lcFileContents = loEntry.InflateToString(lnAddCR) ? lcFileContents ENDIF |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2007 Chilkat Software, Inc. All Rights Reserved.
Mail Component · .NET Email Component · ASP Mail Component · XML Parser