All,
Having a little trouble zipping files together on the server in preparation for download. The user is presented with a web tree containing items for download. The user selects the reports they want and then I get to zip then up on the server and download the file. This all started when users were trying to download 20-30 reports and the limitations of adding items to the header. For example: Response.AddHeader("Content-Disposition", "attachment; filename=""" & filename & """"); can only download one file, I have to pop open a new window for each file!
So here is the code which runs fine from my localhost (eval version of winzip installed). But not when running from the web serser (Full verison of winzip installed)
I thought by calling winzip32.exe from the server side code would open winzip on the server. Could I be running into a permissions issue?
* Sine scientia ars nihil est
* Respondeat superior
Having a little trouble zipping files together on the server in preparation for download. The user is presented with a web tree containing items for download. The user selects the reports they want and then I get to zip then up on the server and download the file. This all started when users were trying to download 20-30 reports and the limitations of adding items to the header. For example: Response.AddHeader("Content-Disposition", "attachment; filename=""" & filename & """"); can only download one file, I have to pop open a new window for each file!
So here is the code which runs fine from my localhost (eval version of winzip installed). But not when running from the web serser (Full verison of winzip installed)
I thought by calling winzip32.exe from the server side code would open winzip on the server. Could I be running into a permissions issue?
Code:
Protected Sub wibZip_Click(ByVal sender As Object, ByVal e As Infragistics.WebUI.WebDataInput.ButtonEventArgs) Handles wibZip.Click
lblErrorText.Text = ""
Dim igNode As Infragistics.WebUI.UltraWebNavigator.Node
Dim fileName As String = ""
Dim filePath As String = ""
Dim fullPath As String = ""
Dim fileText As String = ""
Dim UserId As String = Session.Item("UserId").ToString.Trim
Dim outFileName As String = String.Format("{0}_{1}", UserId, Date.Now.ToString("yyyyMMddHHmmss"))
Dim fileArray As New ArrayList
If uwtRepository.CheckedNodes.Count = 0 Then
lblErrorText.Text = "Please select at least one file"
Exit Sub
End If
For Each igNode In uwtRepository.CheckedNodes
If Not String.IsNullOrEmpty(igNode.Tag) Then
fullPath = igNode.Tag.ToString
fileName = fullPath.Substring(fullPath.LastIndexOf("\") + 1)
filePath = fullPath.Substring(0, fullPath.LastIndexOf("\"))
If File.Exists(String.Format("\\XXX.X.X.XX\M\dir\{0}", fullPath)) Then
fileText &= String.Format("\\XXX.X.X.XX\M\dir\{0}{1}", fullPath, vbCrLf)
End If
End If
Next
File.AppendAllText(String.Format("c:\{0}.txt", outFileName), fileText)
'winzip32 [-min] action [options] filename[.zip] files
Dim startInfo As System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Process
startInfo = New System.Diagnostics.ProcessStartInfo("\\WebServer\c$\Program Files\WinZip\WinZip32.Exe")
startInfo.Arguments = String.Format("-a -p -ex {0}.zip @{0}.txt", String.Format("c:\{0}", outFileName))
startInfo.WindowStyle = Diagnostics.ProcessWindowStyle.Maximized
'pStart.PriorityClass = Diagnostics.ProcessPriorityClass.High
pStart.StartInfo = startInfo
pStart.Start()
End Sub
* Sine scientia ars nihil est
* Respondeat superior