button to download a file

Discussion in 'Javascript' started by Andrew Poulos, Mar 5, 2007.

  1. There's a file on the server that users may download. I can display a
    link and have people right-mouse click it and choose "save..." but is
    there a way to have a button the user clicks that pops up the "save as"
    dialog?

    I note there's a download behaviour for IE (which doesn't seem to work
    in IE 6) but I was hoping for a cross browser solution.

    Andrew Poulos
     
    Andrew Poulos, Mar 5, 2007
    #1
    1. Advertising

  2. Andrew Poulos

    ASM Guest

    Andrew Poulos a écrit :
    > There's a file on the server that users may download. I can display a
    > link and have people right-mouse click it and choose "save..." but is
    > there a way to have a button the user clicks that pops up the "save as"
    > dialog?


    put files in *.zip


    --
    Stephane Moriaux et son (moins) vieux Mac déjà dépassé
    Stephane Moriaux and his (less) old Mac already out of date
     
    ASM, Mar 5, 2007
    #2
    1. Advertising

  3. Andrew Poulos

    Walton Guest

    On Mar 5, 4:55 am, Andrew Poulos <> wrote:
    > There's a file on the server that users may download. I can display a
    > link and have people right-mouse click it and choose "save..." but is
    > there a way to have a button the user clicks that pops up the "save as"
    > dialog?


    just for an fyi:

    browsers will popup the "save as" dialog depending on what the mime
    type of the file is you are linking to. so for instance if you have a
    pdf file, your browser sees the mime type as "application/pdf" and
    will attemp to open it in the browser. if you have a .zip file, your
    browser will see the mime type "application/zip" and recognize that it
    should NOT try to open this file in the browser and you will get the
    "save as" dialog popup.

    Different mime types will either open the "save as" dialog or just try
    to open the browser, and maybe some other action i'm missing. I'm not
    sure if there are settings in the browser to change those behaviors or
    not.
     
    Walton, Mar 5, 2007
    #3
    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. Do
    Replies:
    1
    Views:
    362
    William LaMartin
    Nov 28, 2003
  2. Ryan Taylor
    Replies:
    2
    Views:
    1,025
    Ryan Taylor
    Nov 10, 2004
  3. Steve C. Orr [MVP, MCSD]
    Replies:
    0
    Views:
    1,667
    Steve C. Orr [MVP, MCSD]
    Mar 7, 2005
  4. Sam --
    Replies:
    2
    Views:
    668
    Sam --
    Mar 17, 2005
  5. Brett  Kelly
    Replies:
    1
    Views:
    724
    Steve C. Orr [MVP, MCSD]
    Jun 16, 2006
Loading...

Share This Page