Way to close the UA after forced file download?

Discussion in 'ASP General' started by MyndPhlyp, May 21, 2005.

  1. MyndPhlyp

    MyndPhlyp Guest

    I am pushing a file download to the client. The ASP used to generate and
    push the file is triggered by an <a target="_blank" href="something">. The
    VBScript uses

    Response.Clear
    Response.ContentType = [some mime type]
    Response.AddHeader "Content-Disposition", "attachment; filename=myfile.txt"
    Response.Write [stuff]
    Response.Flush
    Response.End

    All is working fine. The user is prompted for the disposition of the
    download, the file is transferred. Life is wonderful ... except for one
    minor annoyance ...

    The user is left with a blank page (containing minimal skeletal HTML) in
    front of them after the download.

    Is there a way to eliminate the blank page without having to redirect back
    to the calling page?
    MyndPhlyp, May 21, 2005
    #1
    1. Advertising

  2. MyndPhlyp

    Adrienne Guest

    Gazing into my crystal ball I observed "MyndPhlyp" <>
    writing in news::

    > I am pushing a file download to the client. The ASP used to generate
    > and push the file is triggered by an <a target="_blank"
    > href="something">. The VBScript uses
    >
    > Response.Clear
    > Response.ContentType = [some mime type]
    > Response.AddHeader "Content-Disposition", "attachment;
    > filename=myfile.txt" Response.Write [stuff]
    > Response.Flush
    > Response.End
    >
    > All is working fine. The user is prompted for the disposition of the
    > download, the file is transferred. Life is wonderful ... except for one
    > minor annoyance ...
    >
    > The user is left with a blank page (containing minimal skeletal HTML)
    > in front of them after the download.
    >
    > Is there a way to eliminate the blank page without having to redirect
    > back to the calling page?
    >
    >
    >


    Yes, stop using the target attribute. The target attribute is deprecated
    except for the Frameset element.

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, May 21, 2005
    #2
    1. Advertising

  3. MyndPhlyp

    MyndPhlyp Guest

    "Adrienne" <> wrote in message
    news:Xns965D5AB3FBE65arbpenyahoocom@207.115.63.158...
    >
    > Yes, stop using the target attribute. The target attribute is deprecated
    > except for the Frameset element.


    I have found nothing indicating that the target attribute in anchors is
    depreciated. The HTML 4.01 specifications do not show it depreciated plus
    the W3 HTML Validator for DOCTYPES XHTML 1.0 Transitional and HTML 4.01
    Transitional does not flag it as depreciated.

    Cite your source.

    (But yes, removing the target attribute does cure the symptom. Thanx.)
    MyndPhlyp, May 21, 2005
    #3
  4. MyndPhlyp wrote:
    > "Adrienne" <> wrote in message
    > news:Xns965D5AB3FBE65arbpenyahoocom@207.115.63.158...
    >>
    >> Yes, stop using the target attribute. The target attribute is
    >> deprecated except for the Frameset element.

    >
    > I have found nothing indicating that the target attribute in anchors
    > is depreciated. The HTML 4.01 specifications do not show it
    > depreciated plus the W3 HTML Validator for DOCTYPES XHTML 1.0
    > Transitional and HTML 4.01 Transitional does not flag it as
    > depreciated.
    >
    > Cite your source.
    >


    Ummm, just do a google for deprecated target attribute.

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], May 21, 2005
    #4
  5. MyndPhlyp

    Bob Lehmann Guest

    You're right. It's not depreciated. Attributes retain their value throught
    their lifetime.

    It is, however, deprecated.
    http://www.google.com/search?hl=en&safe=off&q=target attribute deprecated&spell=1

    Bob Lehmann

    "MyndPhlyp" <> wrote in message
    news:...
    >
    > "Adrienne" <> wrote in message
    > news:Xns965D5AB3FBE65arbpenyahoocom@207.115.63.158...
    > >
    > > Yes, stop using the target attribute. The target attribute is

    deprecated
    > > except for the Frameset element.

    >
    > I have found nothing indicating that the target attribute in anchors is
    > depreciated. The HTML 4.01 specifications do not show it depreciated plus
    > the W3 HTML Validator for DOCTYPES XHTML 1.0 Transitional and HTML 4.01
    > Transitional does not flag it as depreciated.
    >
    > Cite your source.
    >
    > (But yes, removing the target attribute does cure the symptom. Thanx.)
    >
    >
    Bob Lehmann, May 21, 2005
    #5
  6. MyndPhlyp

    MyndPhlyp Guest

    "Bob Lehmann" <> wrote in message
    news:OjKcj%...
    > You're right. It's not depreciated. Attributes retain their value throught
    > their lifetime.
    >
    > It is, however, deprecated.
    >

    http://www.google.com/search?hl=en&safe=off&q=target attribute deprecated&spell=1

    ROFL - and every time I have read "deprecated" my fogged brain plugged in
    "depreciated." 'Bout time I was shown the error of my ways. Thanx.

    I did do a little more digging. While the HTML 4.01 Specifications did not
    list anything there were some other pages over at W3 that suggest one should
    refrain from using it, seemingly primarily because of all the pop-up
    blockers popping up (at the risk of sounding redundant). Maybe some day W3
    will get around to adding that check in their HTML Validator. (Hey, it's
    free so don't complain.)

    One thing I don't understand is that W3 is still in favor of frames - an
    element (structure?) not held in the highest respect among some circles
    (and, to some, found to be akin to the blink tag that thankfully was never
    fully embraced). I would have expected them to phase out frames before the
    ability to spawn another browser instance. Ah well ... onwards.
    MyndPhlyp, May 21, 2005
    #6
  7. It is deprecated, but I wouldnt worry about it too much. Target attributes
    are going to keep working for a long time and you are going to see then used
    all over the place.


    "MyndPhlyp" <> wrote in message
    news:%...
    >
    > "Bob Lehmann" <> wrote in message
    > news:OjKcj%...
    >> You're right. It's not depreciated. Attributes retain their value
    >> throught
    >> their lifetime.
    >>
    >> It is, however, deprecated.
    >>

    > http://www.google.com/search?hl=en&safe=off&q=target attribute deprecated&spell=1
    >
    > ROFL - and every time I have read "deprecated" my fogged brain plugged in
    > "depreciated." 'Bout time I was shown the error of my ways. Thanx.
    >
    > I did do a little more digging. While the HTML 4.01 Specifications did not
    > list anything there were some other pages over at W3 that suggest one
    > should
    > refrain from using it, seemingly primarily because of all the pop-up
    > blockers popping up (at the risk of sounding redundant). Maybe some day W3
    > will get around to adding that check in their HTML Validator. (Hey, it's
    > free so don't complain.)
    >
    > One thing I don't understand is that W3 is still in favor of frames - an
    > element (structure?) not held in the highest respect among some circles
    > (and, to some, found to be akin to the blink tag that thankfully was never
    > fully embraced). I would have expected them to phase out frames before the
    > ability to spawn another browser instance. Ah well ... onwards.
    >
    >
    Kyle Peterson, May 21, 2005
    #7
  8. MyndPhlyp

    MyndPhlyp Guest

    "Kyle Peterson" <> wrote in message
    news:%23t3%...
    > It is deprecated, but I wouldnt worry about it too much. Target attributes
    > are going to keep working for a long time and you are going to see then

    used
    > all over the place.


    Yep. I use them quite a bit myself when a link goes out of the site. Thanx
    again.
    MyndPhlyp, May 22, 2005
    #8
  9. MyndPhlyp

    Adrienne Guest

    Gazing into my crystal ball I observed "MyndPhlyp" <>
    writing in news::

    >
    > "Kyle Peterson" <> wrote in message
    > news:%23t3%...
    >> It is deprecated, but I wouldnt worry about it too much. Target
    >> attributes are going to keep working for a long time and you are going
    >> to see then used all over the place.

    >
    > Yep. I use them quite a bit myself when a link goes out of the site.
    > Thanx again.
    >
    >


    The reason the target attribute is deprecated for documents not in a
    frameset is because it breaks that back button.

    I use mouse gestures and am happily gesturing back when I realize nothing
    is happening, then I look up and see the back button is disabled.

    For some users this can be disorienting or confusing. Further, on some
    systems with little resources, spawning a new window can be slow and eats
    up even more resources.

    Most people know how to use the back button, or back space, or gesture
    back. Please don't break the browser's fuctionality. If the person
    wants to go back to your site, they will.

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, May 22, 2005
    #9
  10. I am sorry but that is just plain stupid.
    About as stupid as replaying to posts at the bottom of the message instead
    of the top.


    "Adrienne" <> wrote in message
    news:Xns965DD97E46822arbpenyahoocom@207.115.63.158...
    > Gazing into my crystal ball I observed "MyndPhlyp" <>
    > writing in news::
    >
    >>
    >> "Kyle Peterson" <> wrote in message
    >> news:%23t3%...
    >>> It is deprecated, but I wouldnt worry about it too much. Target
    >>> attributes are going to keep working for a long time and you are going
    >>> to see then used all over the place.

    >>
    >> Yep. I use them quite a bit myself when a link goes out of the site.
    >> Thanx again.
    >>
    >>

    >
    > The reason the target attribute is deprecated for documents not in a
    > frameset is because it breaks that back button.
    >
    > I use mouse gestures and am happily gesturing back when I realize nothing
    > is happening, then I look up and see the back button is disabled.
    >
    > For some users this can be disorienting or confusing. Further, on some
    > systems with little resources, spawning a new window can be slow and eats
    > up even more resources.
    >
    > Most people know how to use the back button, or back space, or gesture
    > back. Please don't break the browser's fuctionality. If the person
    > wants to go back to your site, they will.
    >
    > --
    > Adrienne Boswell
    > http://www.cavalcade-of-coding.info
    > Please respond to the group so others can share
    Kyle Peterson, May 22, 2005
    #10
  11. MyndPhlyp

    Roland Hall Guest

    OT rebut

    "Kyle Peterson" wrote in message
    news:%...
    :I am sorry but that is just plain stupid.
    : About as stupid as replaying to posts at the bottom of the message instead
    : of the top.

    to rebut your "stupid" comments...

    Do you read a book from back to front?
    Is the first paragraph of the book at the back and each subsequent paragraph
    immediately preceding the prior?
    Perhaps the table of contents reads from the bottom up?
    How about page numbers?
    Is this how you see the alphabet? zyxwvutsrqponmlkjihgfedcba
    When you get a receipt, for any purchase, does it read up or down?
    Do you answer questions before they are asked of you?

    There are probably many reasons people top post so this may not be a
    complete list...

    ....because the text cursor is at the top.
    ....because they got this ridiculous habit from email.
    ....because they're lazy.
    ....because they're selfish.
    ....because they just don't care.
    ....because they don't realize how difficult it is for someone to follow
    along who hasn't read each subsequent post.
    ....because nobody ever showed them a different way and explained it to them.
    ....because they're an idiot. (You may fall into this category, among others)

    But, I have a better question that I doubt you can answer.
    If you feel it is stupid to bottom post vs. top post why would you include
    the previous text? This is a newsgroup so the prior text is already posted.
    Why repeat it?

    It makes sense to repeat it if you bottom post so only the last post in any
    thread need be read.
    It makes sense to repeat relevant parts when *replying* inline as you would
    with any conversation.
    It makes no sense to include it when you top post because nobody goes to the
    bottom of a message, scrolls up to find the last post, reads down, scrolls
    up, reads down, scrolls up, reads down, etc. because that's stupid. Rather
    (not Dan) they would then go to the first post and then read each one which
    would negate the reason you probably top post.

    So, either it's stupid to top post and include the prior text because it's
    useless or because you think that's the way a message should read (scroll
    down, scroll up, read down, scroll up, read down...).

    You're in a newsgroup where each post in a thread is located below the
    previous post. How can you then justify your method of posting which
    conflicts with the way the newsgroup and your newsreader function, not to
    mention the proper way to read/write the English language, left to right and
    top to bottom?

    Why didn't you respond with:
    ..pot eht fo daetsni egassem eht fo mottob eht ta stsop ot gniyalper sa
    diputs sa tuobA
    ..diputs nialp tsuj si taht tub yrros ma I

    or:

    top. the of
    instead message the of bottom the at posts to replaying as stupid as About
    stupid. plain just is that but sorry am I

    It would enforce your argument but yet it would still have the same effect
    as you posted. It would be stupid.

    Adrienne said, "Please..." be considerate of others and your response was
    "that's stupid. Now let me talk about how stupid you post."

    While I may not fully agree with Adrienne's comments, I don't think they're
    stupid. I do however disagree with yours AND I think they're stupid, but
    that's just my opinion.

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, May 22, 2005
    #11
  12. MyndPhlyp

    MyndPhlyp Guest

    tuber TO

    "Kyle Peterson" <> wrote in message
    news:%...
    > About as stupid as replaying to posts at the bottom of the message instead
    > of the top.


    The accepted practice (at least by the majority participating in more
    technically oriented NGs) is to bottom post as it places the text in
    chronological order and allows for natural reading. Consider a single
    posting that covers multiple points one wishes to comment on individually.
    The respondent would normally find the section of interest, insert a couple
    of blank lines, and respond in line beneath the section - again, top to
    bottom. Another accepted practice is to trim signature lines. While it may
    be desirable to retain all the text from the thread in the reply to place
    things in context, it is common practice to limit the old text to no more
    than 25% of the full posting preferably leaving only the bits needed to
    illustrate the subject of the reply.

    But all that is a matter for the 'Net police.
    MyndPhlyp, May 22, 2005
    #12
  13. MyndPhlyp

    Adrienne Guest

    Gazing into my crystal ball I observed "Kyle Peterson"
    <> writing in
    news:#:

    > I am sorry but that is just plain stupid.
    > About as stupid as replaying to posts at the bottom of the message
    > instead of the top.
    >


    Plonk!

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, May 23, 2005
    #13
  14. MyndPhlyp

    Roland Hall Guest

    "Adrienne" wrote in message
    news:Xns965EF0D2C469Carbpenyahoocom@207.115.63.158...
    : Gazing into my crystal ball I observed "Kyle Peterson"
    : <> writing in
    : news:#:
    :
    : > I am sorry but that is just plain stupid.
    : > About as stupid as replaying to posts at the bottom of the message
    : > instead of the top.
    : >
    :
    : Plonk!

    Aww.. po' lil Adrienne can insult people for no reason but doesn't like to
    be called on it but felt it was warranted to let me know they were ignoring
    me, well, at least after the notice. So dramatic... ~sigh~
    Some days are more fun than others. (O:=
    Roland Hall, May 23, 2005
    #14
  15. Roland Hall wrote:
    > "Adrienne" wrote in message
    > news:Xns965EF0D2C469Carbpenyahoocom@207.115.63.158...
    >> Gazing into my crystal ball I observed "Kyle Peterson"
    >> <> writing in
    >> news:#:
    >>
    >>> I am sorry but that is just plain stupid.
    >>> About as stupid as replaying to posts at the bottom of the message
    >>> instead of the top.
    >>>

    >>
    >> Plonk!

    >
    > Aww.. po' lil Adrienne can insult people for no reason


    Huh? When did she insult someone? Did I miss something?

    Bob
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], May 23, 2005
    #15
  16. "Bob Barrows [MVP]" <> wrote in message
    news:%23mqoes%...
    > Roland Hall wrote:
    >> "Adrienne" wrote in message
    >> news:Xns965EF0D2C469Carbpenyahoocom@207.115.63.158...
    >>> Gazing into my crystal ball I observed "Kyle Peterson"
    >>> <> writing in
    >>> news:#:
    >>>
    >>>> I am sorry but that is just plain stupid.
    >>>> About as stupid as replaying to posts at the bottom of the message
    >>>> instead of the top.
    >>>>
    >>>
    >>> Plonk!

    >>
    >> Aww.. po' lil Adrienne can insult people for no reason

    >
    > Huh? When did she insult someone? Did I miss something?


    I think Roland went into postal mode but forgot to aim. :) Roland, Kyle is
    the one your after. The rest of us are innocent bystanders.
    Chris Hohmann, May 24, 2005
    #16
  17. "Chris Hohmann" <> wrote in message
    news:u3Bj66%...
    > I think Roland went into postal mode but forgot to aim. :) Roland, Kyle
    > is the one your after. The rest of us are innocent bystanders.


    your = you're
    Chris Hohmann, May 24, 2005
    #17
  18. MyndPhlyp

    Roland Hall Guest

    "Bob Barrows [MVP]" <> wrote in message
    news:%23mqoes%...
    : Roland Hall wrote:
    : > "Adrienne" wrote in message
    : > news:Xns965EF0D2C469Carbpenyahoocom@207.115.63.158...
    : >> Gazing into my crystal ball I observed "Kyle Peterson"
    : >> <> writing in
    : >> news:#:
    : >>
    : >>> I am sorry but that is just plain stupid.
    : >>> About as stupid as replaying to posts at the bottom of the message
    : >>> instead of the top.
    : >>>
    : >>
    : >> Plonk!
    : >
    : > Aww.. po' lil Adrienne can insult people for no reason
    :
    : Huh? When did she insult someone? Did I miss something?

    No, I did. It's called a brain. I don't know why I thought Adrienne was
    plonking me.

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, May 24, 2005
    #18
  19. MyndPhlyp

    Roland Hall Guest

    "Chris Hohmann" <> wrote in message
    news:u3Bj66%...
    : "Bob Barrows [MVP]" <> wrote in message
    : news:%23mqoes%...
    : > Roland Hall wrote:
    : >> "Adrienne" wrote in message
    : >> news:Xns965EF0D2C469Carbpenyahoocom@207.115.63.158...
    : >>> Gazing into my crystal ball I observed "Kyle Peterson"
    : >>> <> writing in
    : >>> news:#:
    : >>>
    : >>>> I am sorry but that is just plain stupid.
    : >>>> About as stupid as replaying to posts at the bottom of the message
    : >>>> instead of the top.
    : >>>>
    : >>>
    : >>> Plonk!
    : >>
    : >> Aww.. po' lil Adrienne can insult people for no reason
    : >
    : > Huh? When did she insult someone? Did I miss something?
    :
    : I think Roland went into postal mode but forgot to aim. :) Roland, Kyle
    is
    : the one your after. The rest of us are innocent bystanders.

    I was actually taking up for her because I thought it was unwarranted and
    then I made a stupid mistake. I guess I deserve to be plonked now.

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, May 24, 2005
    #19
  20. MyndPhlyp

    Roland Hall Guest

    "Chris Hohmann" <> wrote in message
    news:uiqSOJ$...
    :
    : "Chris Hohmann" <> wrote in message
    : news:u3Bj66%...
    : > I think Roland went into postal mode but forgot to aim. :) Roland, Kyle
    : > is the one your after. The rest of us are innocent bystanders.
    :
    : your = you're
    :

    Aw crap! You're right. I'm such an idiot and I thought I'd get wiser with
    age. My apologies to Adrienne for my stupidity.

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, May 24, 2005
    #20
    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. Darren

    Forced Download of PDF

    Darren, Mar 2, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    379
    Darren
    Mar 3, 2005
  2. Replies:
    1
    Views:
    463
    =?Utf-8?B?bGF0aGEgdmFsbGluYXlhZ2Ft?=
    May 5, 2005
  3. xeroxero

    ASP.NET Forced Download Not Working

    xeroxero, Jan 25, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    518
  4. dany

    forced file download

    dany, Jul 1, 2003, in forum: ASP General
    Replies:
    1
    Views:
    123
  5. Iñaki Baz Castillo
    Replies:
    7
    Views:
    843
    Iñaki Baz Castillo
    Jan 12, 2010
Loading...

Share This Page