Professional Web Applications Themes

Forcing File Download Save/Open dialogue - Macromedia Dreamweaver

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....

  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. #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" <webforumsusermacromedia.com> wrote in message
    news:bemsn9$e16$1forums.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

  3. #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

  4. #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

Similar Threads

  1. Download File/Open .pdf from Flex UI
    By rrm-etal in forum Macromedia Flex General Discussion
    Replies: 3
    Last Post: April 24th, 07:33 PM
  2. Open file, make changes, save file, close, re-open, file contents not changed
    By brock@bergdesign.com in forum Adobe Illustrator Macintosh
    Replies: 7
    Last Post: March 7th, 07:29 PM
  3. Open/Save File Dialog
    By flash392 in forum Adobe Flash, Flex & Director
    Replies: 1
    Last Post: February 18th, 11:14 AM
  4. Save for Web Dialogue does not appear
    By Don Stouder in forum Adobe Photoshop Elements
    Replies: 3
    Last Post: July 19th, 03:34 PM
  5. forcing Excel to open file
    By shank in forum ASP
    Replies: 1
    Last Post: July 9th, 09:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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