ChilkatZipEntry2 ActiveX Reference

ChilkatZipEntry2

Represents a single file or directory entry within a Chilkat Zip object.

Object Creation

(Visual Basic 6.0)
Dim obj As New ChilkatZipEntry2
(ASP)
set obj = Server.CreateObject("Chilkat.ZipEntry2")
(VBScript)
set obj = CreateObject("Chilkat.ZipEntry2")
(Delphi)
obj := TChilkatZipEntry2.Create(Self);
(FoxPro)
loObject = CreateObject('Chilkat.ZipEntry2')
(SQL Server)
EXEC @hr = sp_OACreate 'Chilkat.ZipEntry2', @obj OUT
(Javascript)
var obj = new ActiveXObject("Chilkat.ZipEntry2");

Properties

Comment As String

The comment stored within the Zip for this entry.

CompressedLength As Long (read-only)

The size in bytes of this entry's file data when compression is applied

CompressedLengthStr As String (read-only)

The size in decimal string format of this file when Zip compression is applied.

CompressionLevel As Long

The compression level. 0 = no compression, while 9 = maximum compression. The default is 6.

CompressionMethod As Long

Set to 0 for no compression, or 8 for the Deflate algorithm. The Deflate algorithm is the default algorithm of the most popular Zip utility programs, such as WinZip

Crc As Long (read-only)

The CRC for the zip entry.

EntryID As Long (read-only)

The unique ID assigned by Zip.NET while the object is instantiated in memory.

EntryType As Long (read-only)

Indicates the origin of the entry. There are three possible values: (0) an entry in an existing Zip file, (1) a file on disk referenced by Zip.NET and to be added to the Zip, and (2) an entry created directly from data in memory.

FileDateTime As Date

The last-modified time of the Zip entry.

FileName As String

The file name of the Zip entry.

IsDirectory As Long (read-only)

True if the Zip entry is a directory, false if it is a file.

LastErrorHtml As String (read-only)

Error information in HTML format for the last method called.

LastErrorText As String (read-only)

Error information in plain-text format for the last method called.

LastErrorXml As String (read-only)

Error information in XML format for the last method called.

UncompressedLength As Long (read-only)

The size in bytes of this entry's file data when uncompressed.

UncompressedLengthStr As String (read-only)

The size in bytes (in decimal string format) of this zip entry's data when uncompressed.

Methods

AppendData(data As Variant)

Appends binary data to the zip entry's file contents.

Copy() As Variant

Returns the compressed data as a byte array.

Returns a zero-length byte array (as a Variant) on failure.
An empty array will have a UBound of -1 meaning 0 elements.

CopyToBase64() As String

Returns the compressed data as a Base64-encoded string. This data can be re-added to a Zip by calling Zip.AppendBase64.

Returns a null on failure

CopyToHex() As String

Returns the compressed data as a hexidecimal encoded string. This data can be re-added to a Zip by calling Zip.AppendHex.

Returns a null on failure

Extract(dirPath As String) As Long

Unzips this entry into the specified base directory. The file is unzipped to the subdirectory according to the relative path stored with the entry in the Zip. Use ExtractInto to unzip into a specific directory regardless of the path information stored in the Zip.

ExtractInto(dirPath As String) As Long

Unzip a file into a specific directory

Inflate() As Variant

Inflate a file within a Zip directly into memory.

Returns a zero-length byte array (as a Variant) on failure.
An empty array will have a UBound of -1 meaning 0 elements.

InflateToString(addCR As Long) As String

Inflate and return the uncompressed data as a string. Line-endings are modified to include or not include carriage-returns based on KeepCR. If KeepCR = False, then bare linefeeds are returned, otherwise CRLFs are returned.

Returns a null on failure

InflateToString2() As String

Unzip a file directly into memory as a string, and leave line-endings unmodified.

Returns a null on failure

InflateToString3(srcCharset As String) As String

Inflates a character data from a specified character encoding (such as iso-8859-1, or Shift_JIS) and returns the inflated data as a Unicode string.

Returns a null on failure

NextEntry() As ChilkatZipEntry2

Return the next entry (file or directory) within the Zip

Returns a null reference on failure

ReplaceData(data As Variant)

Replaces the zip entry's existing contents with new data.

SaveLastError(filename As String)

Saves the last error information to an XML formatted file.