Force browser download code crashing webserver.

Discussion in 'ASP General' started by PingBad, Jan 23, 2009.

  1. PingBad

    PingBad Guest

    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?
    PingBad, Jan 23, 2009
    #1
    1. Advertising

  2. PingBad

    Bob Barrows Guest

    PingBad wrote:
    > 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.


    --
    HTH,
    Bob Barrows
    Bob Barrows, Jan 23, 2009
    #2
    1. Advertising

  3. PingBad

    Evertjan. Guest

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

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Jan 23, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Temp

    Browser Crashing... ????

    Temp, Aug 9, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    318
    MS News \(MS ILM\)
    Aug 9, 2003
  2. Christophe Vanfleteren

    Download Files From Webserver

    Christophe Vanfleteren, Oct 6, 2003, in forum: Java
    Replies:
    5
    Views:
    461
    Andrew
    Oct 7, 2003
  3. Owen Blacker

    Visual Studio 2005 webserver crashing

    Owen Blacker, May 19, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,082
  4. HaRoOn
    Replies:
    1
    Views:
    695
    scripts.contact
    Apr 19, 2007
  5. JP SIngh

    ASP Force Download of file from webserver

    JP SIngh, Jun 21, 2005, in forum: ASP General
    Replies:
    2
    Views:
    184
    Bullschmidt
    Jun 30, 2005
Loading...

Share This Page