Forcing File Download Save/Open dialogue

Ask a Question related to Macromedia Dreamweaver, Design and Development.

  1. #1

    Default Forcing File Download Save/Open dialogue

    I'm downloading a file using HTML <a> href.

    If it is a "known" file type, then the file opens in that applications window ( a Word .doc for instance). How do I force the browser to open the File Download dialogue so that, for instance, I can save a Word .doc to disk rather than open it? Is it bit of Javascript code? Could someone send me a snippet?

    Thanking you in anticipation.






    rogerwithnell webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. Download File/Open .pdf from Flex UI
      I'd like our users to be able to download/open files from our WEB page (being developed in FLEX Builder 3). The file Reference class seems like...
    2. Open file, make changes, save file, close, re-open, file contents not changed
      I've now run into this several times and it's completely destroyed all of my confidence in Ilustrator CS on Mac. I'm hoping someone can confirm that...
    3. Open/Save File Dialog
      Is there a way to open the open/save file dialog in flash without useing javascript? I'm trying to develop this for a stand alone distribution and...
    4. Save for Web Dialogue does not appear
      Hello, I have encountered a strange problem while running PSE Vers 2 on Win XP that I have never seen before. The problem is this: When trying...
    5. forcing Excel to open file
      I have the following code at the top of my page. Is there a way to force Excel to open the spreadsheet? Presently, it opens within the browser...
  3. #2

    Default Re: Forcing File Download Save/Open dialogue

    Zip it.

    --
    Murray --- ICQ 71997575
    Team Macromedia Volunteer for Dreamweaver MX
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]news://forums.macromedia.com/macromedia.dreamweaver[/url] - THE BEST WAY TO GET
    ANSWERS
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.DreamweaverFAQ.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================

    "rogerwithnell" <webforumsuser@macromedia.com> wrote in message
    news:bemsn9$e16$1@forums.macromedia.com...
    > I'm downloading a file using HTML <a> href.
    >
    > If it is a "known" file type, then the file opens in that applications
    window ( a Word .doc for instance). How do I force the browser to open the
    File Download dialogue so that, for instance, I can save a Word .doc to disk
    rather than open it? Is it bit of Javascript code? Could someone send me a
    snippet?
    >
    > Thanking you in anticipation.
    >
    >
    >
    >
    >
    >

    Murray *TMM* Guest

  4. #3

    Default Re: Forcing File Download Save/Open dialogue

    You'd have to use a server-side script to stream the file and force a
    content-type. Use ASP or CF or PHP

    --

    Jules
    [url]http://www.charon.co.uk[/url]

    Charon Cart 3
    [url]http://www.charon.co.uk/charoncart[/url]

    ICQ 51328805



    rogerwithnell wrote:
    > I'm downloading a file using HTML <a> href.
    >
    > If it is a "known" file type, then the file opens in that
    > applications window ( a Word .doc for instance). How do I force the
    > browser to open the File Download dialogue so that, for instance, I
    > can save a Word .doc to disk rather than open it? Is it bit of
    > Javascript code? Could someone send me a snippet?
    >
    > Thanking you in anticipation.

    Julian Roberts Guest

  5. #4

    Default Re: Forcing File Download Save/Open dialogue

    I can't why Access or SQL Server would make as difference. I mean you're
    only extracting a string.

    --

    Jules
    [url]http://www.charon.co.uk[/url]

    Charon Cart 3
    [url]http://www.charon.co.uk/charoncart[/url]

    ICQ 51328805



    rogerwithnell wrote:
    > Thanks for your response.
    >
    > I code in ASP. I can download a Word .doc from a database and save
    > it in the browser's machine if I use an Access database but it fouls
    > up if I use SQL Server (which I have to fix!).
    >
    > My code is:
    > Set db = Server.CreateObject("ADODB.Connection")
    > db.Open strConnection
    >
    > SQL = "SELECT * FROM Files where fFilename = '" &
    > Request("fFileName") & "'"
    > Set rs = db.Execute( SQL )
    > If rs.EOF Then Response.End
    > Response.ContentType = "application/octet-stream"
    >
    > ' Let the browser know the file name
    > Response.AddHeader "Content-Disposition", "attachment;filename=" &
    > Trim(rs("fFilename")) & ""
    >
    > ' Let the browser know the file size
    > Response.AddHeader "Content-Length", CStr(rs("fBytesize"))
    >
    > ' Send actual file
    > Response.BinaryWrite rs("fImage")
    >
    > When using SQL server, the File Download dialogue appears and on
    > selecting Save and clicking OK I get an error message saying that IE
    > cannot connect to the server.
    >
    > Any ideas?

    Julian Roberts 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