I am trying to use sharpziplib with my asp.net website that uses vb.net. When I create a zip file I can use WinRAR to view it and extract it but when I try to use windows folder compression tool, the archive is empty. Here is my code
Dim i As Integer
Dim s As ZipOutputStream = New ZipOutputStream(File.Create(FilePath & "\zipper.zip"))
s.SetLevel(5)
For i = 0 To files.Count - 1
Dim fs As FileStream = File.OpenRead(files(i).ToString)
Dim buffer(fs.Length) As Byte
fs.Read(buffer, 0, buffer.Length)
Dim entry As ZipEntry = New ZipEntry(files(i).ToString)
entry.Size = fs.Length + 1
s.PutNextEntry(entry)
s.Write(buffer, 0, buffer.Length)
Next
s.Finish()
s.Close()