Force browser download code crashing webserver.

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?
 
B

Bob Barrows

PingBad said:
Hey there!

I"m in the midst of a web-based intranet project (using VB.Net 2.0

There was no way for you to know it (except maybe by browsing through
some of the previous questions before posting yours - always a
recommended practice), but this is a classic (COM-based) asp newsgroup.
ASP.Net is a different technology from classic ASP. While you may be
lucky enough to find a dotnet-savvy person here who can answer your
question, you can eliminate the luck factor by posting your question to
a newsgroup where the dotnet-savvy people hang out. I suggest

microsoft.public.dotnet.framework.aspnet.

There are also forums at www.asp.net where you can find a lot of people
to help you.
 
E

Evertjan.

=?Utf-8?B?UGluZ0JhZA==?= wrote on 23 jan 2009 in
microsoft.public.inetserver.asp.general:
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.

This is a classic asp group.

Dotnet questions should be asked in
<microsoft.public.dotnet.framework.aspnet>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top