Sample code for 30+ languages & platforms
Classic ASP

bz2 Compress File

Compress a file to the bz2 file format.

Chilkat Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0

' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

set bz2 = Server.CreateObject("Chilkat.Bz2")

' Compress the file qa_data/hamlet.xml to create qa_output/hamlet.bz2
success = bz2.CompressFile("qa_data/hamlet.xml","qa_output/hamlet.bz2")
If (success <> 1) Then
    Response.Write "<pre>" & Server.HTMLEncode( bz2.LastErrorText) & "</pre>"
    Response.End
End If

Response.Write "<pre>" & Server.HTMLEncode( "Success.") & "</pre>"

%>
</body>
</html>