P
PingBad
Hey there!
I"m in the midst of a web-based intranet project (using VB.Net 2.0 with
SP1), and I'm having a major issue with the code that's used to tell the
client browser to download the results.
Here's the code so far:
Dim fStream As New System.IO.FileStream(SheetPath, IO.FileMode.Open,
IO.FileAccess.Read, IO.FileShare.Read)
With Response
.Buffer = False
.ClearContent()
.ClearHeaders()
.ContentType = System.Net.Mime.MediaTypeNames.Text.Xml
.AppendHeader("Content-length", fStream.Length)
.AppendHeader("Content-disposition", String.Format("attachment;
filename=""{0}""", System.IO.Path.GetFileName(SheetPath)))
'.Cache.SetNoStore()
.TransmitFile(SheetPath)
End With
fStream.Close()
fStream = Nothing
Response.End
The variable "SheetPath" is a string containing the physical location of the
file to be sent to the client browser, but the real issue I'm having with
this code at the moment is that when run on a Win2K3 server (64-Bit R2) the
server will crash (total system lockup, first the LAN connection drops on the
machine, followed by every running process 10 seconds later).
Perhaps someone can point me to where I'm possibly screwing up with the code
I have, or point out a line I'm missing?
I"m in the midst of a web-based intranet project (using VB.Net 2.0 with
SP1), and I'm having a major issue with the code that's used to tell the
client browser to download the results.
Here's the code so far:
Dim fStream As New System.IO.FileStream(SheetPath, IO.FileMode.Open,
IO.FileAccess.Read, IO.FileShare.Read)
With Response
.Buffer = False
.ClearContent()
.ClearHeaders()
.ContentType = System.Net.Mime.MediaTypeNames.Text.Xml
.AppendHeader("Content-length", fStream.Length)
.AppendHeader("Content-disposition", String.Format("attachment;
filename=""{0}""", System.IO.Path.GetFileName(SheetPath)))
'.Cache.SetNoStore()
.TransmitFile(SheetPath)
End With
fStream.Close()
fStream = Nothing
Response.End
The variable "SheetPath" is a string containing the physical location of the
file to be sent to the client browser, but the real issue I'm having with
this code at the moment is that when run on a Win2K3 server (64-Bit R2) the
server will crash (total system lockup, first the LAN connection drops on the
machine, followed by every running process 10 seconds later).
Perhaps someone can point me to where I'm possibly screwing up with the code
I have, or point out a line I'm missing?