I've built a webapplication in which a user can select a zipfile from their filesystem (via an asp:FileUpload). Then the application unzips the zipfile and ftp's every file.
here's the code:
Public Sub Unzip(ByVal str As Stream, ByVal constr As String)
Dim zf As New ZipFile(str)
Dim ze As ZipEntry
Dim i As Integer = 0
While i < zf.Count
ze = zf.EntryByIndex(i)
i = i + 1
Dim ftp As New ftpItem(constr)
ftp.upload(ze.Name, "pic", zf.GetInputStream(i), ze.Name, ze.Name)
End While
zf.Close()
End Sub
The ftpItem class is a class of my own which handles the ftp. ftp.upload needs as third parameter the stream for the file to be sent.
But for some reason zf.GetInputStream(i) always gives nothing.