Xceed Zip for COM/ActiveX on x86/x64 Documentation
Xceed Zip control reference / Xceed Zip control methods / TestZipFile method
In This Topic
    TestZipFile method
    In This Topic

    Description

    The TestZipFile method checks the integrity of a zip file, and can also check to make sure all files inside the zip file can be correctly unzipped back to their original uncompressed form without loss of information.

    The Warning event is triggered whenever an error is detected in the zip file structure. It provides details on any problems encountered.

    The TestZipFile method's return value provides you with the conclusion on the integrity of the zip file.

    Declaration (ActiveX)  
    Method TestZipFile(bCheckCompressedData As Boolean) As xcdError
    Declaration (DLL API)  
    int XzTestZipFile( HXCEEDZIP hZip, BOOL bCheckCompressedData )

    Parameters

    Parameter Description
    bCheckCompressedData  Determines whether or not each file's compressed data should be checked for errors. Setting this property to True will cause Xceed Zip to uncompress each file's data to memory and verify that the file's stored CRC corresponds with the uncompressed data's CRC. Setting this property to False will cause Xceed Zip to skip the compressed data test and report only zip file structure problems. 

    This parameter is optional. If it is not supplied, the default value is True.

    Return values

    A return value of type xcdError is returned. Only the return value of xerSuccess indicates that the method has been completed successfully. See the error codes topic for a list of possible return values.

    Remarks

    If you are trying to determine the integrity of the individual files inside the zip file, as opposed to the integrity of the entire zip file, use the bFileCompleted parameter of the FileStatus event which is also generated when you run the TestZipFile method. When a FileStatus event is triggered with bFileCompleted = True, you know that the current file being tested is correctly unzippable.

    You cannot set the FilesToProcess property to only test certain files in the zip file. The TestZipFile method tests all the files in a zip file when the bCheckCompressedData parameter is set to True.

    Applicable properties

    Abort, EncryptionPassword, ZipFilename

    Events triggered

    InvalidPassword, InsertDisk, SkippingFile, TestingFile, FileStatus, GlobalStatus, Warning and ProcessCompleted