Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
Append to a Zip from a Byte Array
Demonstrates how to append to a .zip from a byte array. Dim zip As New Chilkat.Zip() zip.UnlockComponent("anything for 30-day trial") zip.NewZip("test.zip") ' Rather than appending a file using AppendFiles or AppendOneFileOrDir ' This example loads the file into a byte array, and then appends the byte ' array. Dim fInfo As New System.IO.FileInfo("fw9.pdf") Dim numBytes As Long = fInfo.Length Dim fStream As New System.IO.FileStream("fw9.pdf", System.IO.FileMode.Open, System.IO.FileAccess.Read) Dim br As New System.IO.BinaryReader(fStream) Dim data As Byte() = br.ReadBytes(CInt(numBytes)) br.Close() fStream.Close() zip.AppendData("taxForm.pdf", data) zip.WriteZipAndClose() |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.