SoftArtisans Archive


You received SoftArtisans Archive™ free with your purchase of XFile. SoftArtisans Archive is a sophisticated component for the creation and extraction of Zip and Cab archives.

With SoftArtisans Archive you can,

Using Archive in conjunction with XFile, you can compress several files and upload or download the archive file. You can then use Archive to extract the uploaded files on the server, or the downloaded files on the client.

Exercise 15: Using SoftArtisans Archive on the Client

Create an HTML script, containing the following lines.

<script language="vbs">
      Sub CreateArchive_OnClick()
      // Set the archive format
      // 1 - Zip format
      // 2 - Cab format
      arch.ArchiveType = 1

      // Create the Zip file
      arch.CreateArchive "c:\temp\ZipArch.zip"

      // Add files to the Zip file
      arch.AddFile "c:\report.doc"
      arch.AddFile "c:\image.jpg"
      arch.CloseArchive
      End Sub
      </script>

      <Input Type=Button Name="CreateArchive" Value="Create Archive">

      <Object Classid="clsid:D3400FEE-041F-11D3-B1C5-00A0C9B4587A" Codebase="localhost/SAXFileSamples/saxfile.cab"
      ID="arch">
      </Object>
    

Understanding the Script
Using SoftArtisans Archive on the Server

Exercise 15 demonstrated creating an instance of SoftArtisans Archive on the client, using the <object>tag. You can also use Archive on the server, within an ASP script.

To create an instance of Archive within an ASP script, use Server.CreateObject, as follows.

Set objArchive = Server.CreateObject("Softartisans.Archive")


Copyright © 2010 SoftArtisans, Inc. All rights reserved.