problem with code download file - two window file download

Discussion in 'ASP .Net' started by Sam --, Mar 17, 2005.

  1. Sam --

    Sam -- Guest

    Hi all
    I've a problem
    I write code for download a file.
    Sometimes when I run the code, the window of "File Download" appears
    I push the "open" button and the window of "File Download" appears
    again
    This happens in this situation
    windows 2003 - IE version 6.0.3790.0

    note:
    If i comment the line
    ********
    Response.AppendHeader("content-disposition", "attachment;
    filename=prova.xls")
    *******
    the problem does not happen but I cannot specify the name of the file



    thanks
    Sam --



    '.......................................................................
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles Button1.Click

    With Response
    .Clear()
    .ClearContent()
    .ClearHeaders()

    End With

    Response.ContentType = "application/vnd.ms-excel"
    Response.AppendHeader("content-disposition", "attachment;
    filename=prova.xls")
    Response.Write("test")
    Response.End()
    Response.Flush()
    End Sub
    Sam --, Mar 17, 2005
    #1
    1. Advertising

  2. Hi Sam,
    I noticed a similar problem some time ago on machines installed with open
    office instead of MS office. So if you dont have MS Office installed on your
    machine or Excel viewer then check it on another machine.
    HTH
    srini

    "Sam --" wrote:

    > Hi all
    > I've a problem
    > I write code for download a file.
    > Sometimes when I run the code, the window of "File Download" appears
    > I push the "open" button and the window of "File Download" appears
    > again
    > This happens in this situation
    > windows 2003 - IE version 6.0.3790.0
    >
    > note:
    > If i comment the line
    > ********
    > Response.AppendHeader("content-disposition", "attachment;
    > filename=prova.xls")
    > *******
    > the problem does not happen but I cannot specify the name of the file
    >
    >
    >
    > thanks
    > Sam --
    >
    >
    >
    > '.......................................................................
    > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles Button1.Click
    >
    > With Response
    > .Clear()
    > .ClearContent()
    > .ClearHeaders()
    >
    > End With
    >
    > Response.ContentType = "application/vnd.ms-excel"
    > Response.AppendHeader("content-disposition", "attachment;
    > filename=prova.xls")
    > Response.Write("test")
    > Response.End()
    > Response.Flush()
    > End Sub
    >
    =?Utf-8?B?c3Jpbmk=?=, Mar 17, 2005
    #2
    1. Advertising

  3. Sam --

    Sam -- Guest

    On Thu, 17 Mar 2005 05:43:03 -0800, "srini"
    <> wrote:

    >Hi Sam,
    >I noticed a similar problem some time ago on machines installed with open
    >office instead of MS office. So if you dont have MS Office installed on your
    >machine or Excel viewer then check it on another machine.
    >HTH
    >srini

    I have two machine with windows 2003 - IE version 6.0.3790.0
    One has Office 2002
    The other machine does not have Office for nothing
    The two machines have installed SQL Server 2000 - sp3

    Sam --






    >"Sam --" wrote:
    >
    >> Hi all
    >> I've a problem
    >> I write code for download a file.
    >> Sometimes when I run the code, the window of "File Download" appears
    >> I push the "open" button and the window of "File Download" appears
    >> again
    >> This happens in this situation
    >> windows 2003 - IE version 6.0.3790.0
    >>
    >> note:
    >> If i comment the line
    >> ********
    >> Response.AppendHeader("content-disposition", "attachment;
    >> filename=prova.xls")
    >> *******
    >> the problem does not happen but I cannot specify the name of the file
    >>
    >>
    >>
    >> thanks
    >> Sam --
    >>
    >>
    >>
    >> '.......................................................................
    >> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
    >> System.EventArgs) Handles Button1.Click
    >>
    >> With Response
    >> .Clear()
    >> .ClearContent()
    >> .ClearHeaders()
    >>
    >> End With
    >>
    >> Response.ContentType = "application/vnd.ms-excel"
    >> Response.AppendHeader("content-disposition", "attachment;
    >> filename=prova.xls")
    >> Response.Write("test")
    >> Response.End()
    >> Response.Flush()
    >> End Sub
    >>
    Sam --, Mar 17, 2005
    #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. Ryan Taylor
    Replies:
    2
    Views:
    923
    Ryan Taylor
    Nov 10, 2004
  2. Andrew Bewley via DotNetMonster.com

    window to window communication (window.opener)

    Andrew Bewley via DotNetMonster.com, Feb 3, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,027
    Andrew Bewley via DotNetMonster.com
    Feb 3, 2005
  3. Brett  Kelly
    Replies:
    1
    Views:
    666
    Steve C. Orr [MVP, MCSD]
    Jun 16, 2006
  4. GenxLogic
    Replies:
    3
    Views:
    1,243
    andrewmcdonagh
    Dec 6, 2006
  5. Kev Jackson
    Replies:
    2
    Views:
    100
Loading...

Share This Page