Xojo Plugin
Xojo Plugin
Unzip Text File to String
See more Zip Examples
Demonstrates how to open a .zip and extract the 1st file (assuming it's a text file) to a string variable.Chilkat Xojo Plugin Downloads
Dim success As Boolean
success = False
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Dim zip As New Chilkat.Zip
success = zip.OpenZip("qa_data/zips/EC16100.zip")
If (success = False) Then
System.DebugLog(zip.LastErrorText)
Return
End If
// Get the 1st file in the .zip
Dim entry As New Chilkat.ZipEntry
success = zip.EntryAt(0,entry)
If (success = False) Then
System.DebugLog(zip.LastErrorText)
Return
End If
Dim fileContents As String
fileContents = entry.UnzipToString(0,"utf-8")
System.DebugLog(fileContents)