download file and close window challenge

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default download file and close window challenge

    open the file download.asp from another main.asp page using
    window.open
    what the problem is when i clikc on the hyperlink it prompts me the
    ie save dialog box
    taht fine.
    but when the script ends in download.asp i wanna close the
    download.asp .asp window open in background..
    but that not working.
    how to close the window download.asp as i wanna save the content in
    text format i dont wnat to use the body unload event handler as the
    html tags will be printed in the text file
    guys give yr inputs i am stuick in this..




    function downloadWIN( windowURL ) {
    return window.open( windowURL,'download',
    'width=10,scrollbars=0,height=10,toolbar=0,locatio n=0,directories=0,status=0,menuBar=0,screenX=50,sc reenY=50,left=50,top=50'
    ) }

    <td ><a href="#" onclick="javascript:downloadWIN( "download.asp")">
    >download sample</font></a>
    </td>
    </tr>



    here my file download.asp

    <%
    dim StrFileName
    StrFileName="a.txt"
    Response.ContentType = "text/plain" 'Content Type For File Download
    in Csv Format
    Response.AddHeader "content-disposition","attachment; filename=" &
    StrFileName 'Prompt the user For File Download
    Response.Buffer=true
    Response.Write "hi"
    %>
    <script>
    self.close()
    </script>
    Navin Guest

  2. Similar Questions and Discussions

    1. File close command within an external window
      pdfs created within 6.0.0 Using Link Tool, Custom Link/Execute Menu Item/File/Close Link will then not function when the PDF is opened within a...
    2. close my project that is in a browser window (close this window)
      How can I do this with a button? What do I have to put into button?
    3. Download file and the window close challenge
      Navin wrote on 13 aug 2003 in microsoft.public.inetserver.asp.general: 1 why not simply: <a href="download.asp">download sample</a> 2...
    4. window sizing & close this window code
      Sharon wrote on 16 jul 2003 in microsoft.public.inetserver.asp.general: No ASP to be seen, Sharon, please see a clientside NG, --...
    5. File download prompt window
      Typically, when clicking on a link on the internet that requires a download such as a.mpg file, a window pops up that gives the option to "save to...
  3. #2

    Default Re: download file and close window challenge

    I believe I asked you this before. Why bother with window.open if it's just
    going to return a file to be downloaded. Just get rid of all that.

    Ray at work

    "Navin" <navinsm2@rediffmail.com> wrote in message
    news:5dc7f532.0308130013.209d7b99@posting.google.c om...
    > open the file download.asp from another main.asp page using
    >
    >
    > function downloadWIN( windowURL ) {
    > return window.open( windowURL,'download',
    >
    'width=10,scrollbars=0,height=10,toolbar=0,locatio n=0,directories=0,status=0
    ,menuBar=0,screenX=50,screenY=50,left=50,top=50'
    > ) }
    >
    > <td ><a href="#" onclick="javascript:downloadWIN( "download.asp")">
    > >download sample</font></a>
    > </td>
    > </tr>
    >
    >
    >
    > here my file download.asp
    >
    > <%
    > dim StrFileName
    > StrFileName="a.txt"
    > Response.ContentType = "text/plain" 'Content Type For File Download
    > in Csv Format
    > Response.AddHeader "content-disposition","attachment; filename=" &
    > StrFileName 'Prompt the user For File Download
    > Response.Buffer=true
    > Response.Write "hi"
    > %>
    > <script>

    Ray at Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139