Click here to Skip to main content
15,848,391 members

Comments by Member 7790032 (Top 24 by date)

Member 7790032 3-Oct-11 16:15pm View    
I am not sure what you are asking. ??
Member 7790032 2-Aug-11 11:13am View    
Is there a way to save it to the file stream and directly flush the created zip to the browser without saving a hard copy and if this method would be efficient and not bring down my server...
Member 7790032 2-Aug-11 11:10am View    
Thanks for the input I am using that library to extract the original file and using it to zip them again but I had another concern about loose files that haven't been deleted due to some unforeseen issue.
Member 7790032 2-Aug-11 11:08am View    
Thanks for the response. I have a function that returns the zipped file using that library ,below is my function call
<pre> Public Function ZipFiles(ByVal inputFolderPath As String, ByVal outputPathAndFile As String) As String
Dim outPath As String = Nothing

Dim ar As ArrayList = GenerateFileList_Zipping(inputFolderPath)
' generate file list
Dim TrimLength As Integer = (Directory.GetParent(inputFolderPath)).ToString().Length
' find number of chars to remove // from orginal file path
TrimLength += 1
'remove '\'
Dim ostream As FileStream
Dim obuffer As Byte()
outPath = inputFolderPath & "\" & outputPathAndFile
Dim oZipStream As New ZipOutputStream(File.Create(outPath))
' create zip stream

' maximum compression
Dim oZipEntry As ZipEntry
For Each Fil As String In ar
' for each file, generate a zipentry
oZipEntry = New ZipEntry(Fil.Remove(0, TrimLength))

If Not Fil.EndsWith("/") Then
' if a file ends with '/' its a directory
ostream = File.OpenRead(Fil)
obuffer = New Byte(ostream.Length - 1) {}
ostream.Read(obuffer, 0, obuffer.Length)
oZipStream.Write(obuffer, 0, obuffer.Length)
End If

Catch ex As Exception

If (File.Exists(outputPathAndFile)) Then
End If
End Try

Return outPath
End Function </pre>

but I have to store the file on the server to be downloaded. I don't want a situation of having a bunch of temporary files on the server that wasn't deleted due to some issue
Member 7790032 12-Jul-11 10:39am View    
This was a good solution now I have other issues ate the results are not binding to the grid don't know if it's because I I am using linq to sql with SP but that's a different issue. Thanks.