Xceed Zip for COM/ActiveX on x86/x64 Documentation
Getting started quickly / Creating a spanned zip file
In This Topic
    Creating a spanned zip file
    In This Topic

    One extra thing to do 

    Except for the basic things you have to do to zip or unzip a file, the only extra thing you have to do to create or be able to unzip a spanned zip file is to write a handler for the InsertDisk event. The InsertDisk event is triggered by the library when a new disk must be inserted into the removable media drive in order to continue reading or writing a zip file. The Xceed Zip Compression Library never displays anything on the screen itself (a library should never take that initiative) so you have to display the message box yourself. The advantage is that you get to display whatever you want, any way you want it.

    Here is sample VB code you can put in the InsertDisk event's handler for displaying a simple message box to insert a new or specific disk:

    Visual Basic Copy Code

    If nDiskNumber = xcdLastDisk then
       MessageBox "Please insert the last disk of the zip file set." 
    Else
       MessageBox "Please insert disk " + Str(nDiskNumber) + " of the zip file set." 
    EndIf

    Here is sample Delphi code you can put in the InsertDisk event's handler for displaying a simple message box to insert a new or specific disk:

    Delphi Copy Code

    if ( lDiskNumber = 0 ) then
       ShowMessage( 'Please insert the last disk of the zip file set.') 
    else 
       ShowMessage( 'Please insert disk #' + IntToStr( lDiskNumber ) ); 
    bDiskInserted := true;

    When this is done, the library will automatically span disks when you are writing to floppy disks and they get full, or will automatically request the appropriate disks when you are unzipping from a zip file that spans multiple disks.

    Xceed Zip Compression Library can also read and write zip files that are split onto multiple files in the same location (as opposed to a zip file split onto multiple disks). See the SplitSize property for information on how to do this.