response.binarywrite

Discussion in 'ASP .Net' started by abcd, Aug 15, 2005.

  1. abcd

    abcd Guest

    I am writing a page which uses response.binarywrite to the client, after it
    has completed sending the file I am interested in I want to display some
    mesange like "download completed" etc...I am unable to set such javascript
    .....

    my code

    Response.AddHeader "Content-Disposition", "attachment; filename=" &
    objFile.Name
    Response.AddHeader "Content-Length", objFile.Size
    Response.ContentType = "application/octet-stream"
    Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open
    objStream.Type = 1 Response.CharSet = "UTF-8"
    objStream.LoadFromFile(strAbsFile)
    Response.BinaryWrite(objStream.Read)
    objStream.Close
    Set objStream = Nothing
    Set objFile = Nothing Response.End

    How can I display Windo.alert("download completed") after this code...I put
    this code but doesnt work. Windo.alert is ignored. if I change the
    window.alert location to some other part of the code then I dont get that
    standard doenload dialog box which shows open or save options....moreover
    firrefox behaves differently

    thanks
    abcd, Aug 15, 2005
    #1
    1. Advertising

  2. You'll not be able to do this in the same stream as the binary
    is in if you expect the browser to render your binary.

    --
    Robbe Morris - 2004/2005 Microsoft MVP C#

    Earn money answering .NET Framework
    messageboard posts at EggHeadCafe.com.
    http://www.eggheadcafe.com/forums/merit.asp



    "abcd" <> wrote in message
    news:eHQ7J%...
    >I am writing a page which uses response.binarywrite to the client, after it
    >has completed sending the file I am interested in I want to display some
    >mesange like "download completed" etc...I am unable to set such javascript
    >....
    >
    > my code
    >
    > Response.AddHeader "Content-Disposition", "attachment; filename=" &
    > objFile.Name
    > Response.AddHeader "Content-Length", objFile.Size
    > Response.ContentType = "application/octet-stream"
    > Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open
    > objStream.Type = 1 Response.CharSet = "UTF-8"
    > objStream.LoadFromFile(strAbsFile)
    > Response.BinaryWrite(objStream.Read)
    > objStream.Close
    > Set objStream = Nothing
    > Set objFile = Nothing Response.End
    >
    > How can I display Windo.alert("download completed") after this code...I
    > put this code but doesnt work. Windo.alert is ignored. if I change the
    > window.alert location to some other part of the code then I dont get that
    > standard doenload dialog box which shows open or save options....moreover
    > firrefox behaves differently
    >
    > thanks
    >
    >
    >
    >
    >
    Robbe Morris [C# MVP], Aug 16, 2005
    #2
    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. DAC
    Replies:
    1
    Views:
    1,791
    Steve C. Orr, MCSD
    Jul 31, 2003
  2. =?Utf-8?B?QnJhZCBSb2JlcnRz?=

    RE: Response.BinaryWrite or something causes multiple posts

    =?Utf-8?B?QnJhZCBSb2JlcnRz?=, Aug 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    547
    =?Utf-8?B?RGFuIEM=?=
    Aug 19, 2004
  3. bruce barker
    Replies:
    2
    Views:
    630
    bruce barker
    Aug 19, 2004
  4. =?Utf-8?B?QnJhZCBSb2JlcnRz?=

    RE: Response.BinaryWrite or something causes multiple posts

    =?Utf-8?B?QnJhZCBSb2JlcnRz?=, Aug 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    491
    =?Utf-8?B?QnJhZCBSb2JlcnRz?=
    Aug 19, 2004
  5. Replies:
    1
    Views:
    822
Loading...

Share This Page