Sample code for 30+ languages & platforms
Classic ASP

Ungzip Base64 String

See more Gzip Examples

Suppose you have a gzip in base64 representation that contains a text file, such as XML. This example shows how to decompress and access the string.

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 assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

set gzip = Server.CreateObject("Chilkat.Gzip")

gzipBase64 = "H4sIAAAAAAAE ... X6aZjXO3EwAA"

set bd = Server.CreateObject("Chilkat.BinData")
success = bd.AppendEncoded(gzipBase64,"base64")

success = gzip.UncompressBd(bd)
If (success <> 1) Then
    Response.Write "<pre>" & Server.HTMLEncode( gzip.LastErrorText) & "</pre>"
    Response.End
End If

strXml = bd.GetString("utf-8")
Response.Write "<pre>" & Server.HTMLEncode( "XML:") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( strXml) & "</pre>"

%>
</body>
</html>