File Download Dialog Box -Help

Discussion in 'ASP General' started by Surjit Madiwalar, Oct 5, 2004.

  1. Hi,

    I want to get dialog box(open,save,cancel) for pdf file using asp(vbscript).
    Presently when i click on pdf link on the site..the pdf document opens in
    the browser.

    I have used the below code(download.asp?file=filename):

    <%
    Response.AddHeader "content-disposition", "attachment; filename=" &
    request.querystring("file")
    Response.ContentType = "application/octet-stream"
    %>

    This file resides in the same dir of pdf documents

    Eg:

    Downloads
    |
    --1.pdf
    |
    --2.pdf
    |
    download.asp

    But when i request download.asp with the filename i get dialog box..but when
    i open the pdf file..it gives error saying document can't be read....

    Please let me know your suggestions/inputs.

    Rgds,
    Surjit
     
    Surjit Madiwalar, Oct 5, 2004
    #1
    1. Advertising

  2. I may be wrong but couldn't this be a client side browser issue. There will
    probably be an option in internet explorer that makes it give you the
    choice.

    dont quote me on it though

    "Surjit Madiwalar" <> wrote in message
    news:%...
    > Hi,
    >
    > I want to get dialog box(open,save,cancel) for pdf file using

    asp(vbscript).
    > Presently when i click on pdf link on the site..the pdf document opens in
    > the browser.
    >
    > I have used the below code(download.asp?file=filename):
    >
    > <%
    > Response.AddHeader "content-disposition", "attachment; filename=" &
    > request.querystring("file")
    > Response.ContentType = "application/octet-stream"
    > %>
    >
    > This file resides in the same dir of pdf documents
    >
    > Eg:
    >
    > Downloads
    > |
    > --1.pdf
    > |
    > --2.pdf
    > |
    > download.asp
    >
    > But when i request download.asp with the filename i get dialog box..but

    when
    > i open the pdf file..it gives error saying document can't be read....
    >
    > Please let me know your suggestions/inputs.
    >
    > Rgds,
    > Surjit
    >
    >
     
    Steven Scaife, Oct 5, 2004
    #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. =?Utf-8?B?SWJyYWhpbS4=?=

    File name is displayed Garbled in "File download dialog box"

    =?Utf-8?B?SWJyYWhpbS4=?=, Aug 12, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    484
    =?Utf-8?B?SWJyYWhpbS4=?=
    Aug 12, 2006
  2. =?Utf-8?B?cHJhZGVlcF9UUA==?=

    File download dialog box button events

    =?Utf-8?B?cHJhZGVlcF9UUA==?=, Oct 3, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    918
    Steve C. Orr [MVP, MCSD]
    Oct 3, 2006
  3. Per Padolina
    Replies:
    0
    Views:
    129
    Per Padolina
    Aug 6, 2003
  4. shank

    File Download dialog box

    shank, Dec 5, 2006, in forum: ASP General
    Replies:
    1
    Views:
    179
    shank
    Dec 5, 2006
  5. Tim B

    file download dialog box events

    Tim B, Feb 24, 2007, in forum: Javascript
    Replies:
    1
    Views:
    266
    Randy Webb
    Feb 24, 2007
Loading...

Share This Page