Download link

Discussion in 'HTML' started by David, Nov 24, 2006.

  1. David

    David Guest

    Is there any way with html to put in a link which clicking on will allow a
    visitor to my site to download a file to their computer to save on their
    hard drive as opposed to just being displaying in their browser?

    E.g. to download word .doc files. I want them to be able to click on a link
    on a webpage and a message to pop up saying do you want to download this
    file and they can click yes and save it on their computer.


    David
     
    David, Nov 24, 2006
    #1
    1. Advertising

  2. David

    Dylan Parry Guest

    David wrote:
    > Is there any way with html to put in a link which clicking on will allow a
    > visitor to my site to download a file to their computer to save on their
    > hard drive as opposed to just being displaying in their browser?


    No. If the file is opening in the user's browser, it's because their
    browser is able to support that file type, or has a plugin that does it.
    The only way you have guarantee that the file will be downloaded, as
    opposed to displayed, is to tell the user to right-click and choose
    "save as" (or similar).

    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    Programming, n: A pastime similar to banging one's head
    against a wall, but with fewer opportunities for reward.
     
    Dylan Parry, Nov 24, 2006
    #2
    1. Advertising

  3. David

    Steve Pugh Guest

    David wrote:
    > Is there any way with html to put in a link which clicking on will allow a
    > visitor to my site to download a file to their computer to save on their
    > hard drive as opposed to just being displaying in their browser?


    Use a normal link.

    > E.g. to download word .doc files. I want them to be able to click on a link
    > on a webpage and a message to pop up saying do you want to download this
    > file and they can click yes and save it on their computer.


    <a href="whatever.doc">Whatever</a>

    What happens when the user clicks on it is entirely up to how the user
    has their browser configured.

    Sometimes it will be saved automatically, sometimes it will be opened
    in Word, sometimes it will be opened by a copy of Word running within
    the browser, sometimes it cause the user to be asked what to do.

    And then the user can always over ride their default setting by right
    clicking on the link and selecting a different option from the context
    menu.

    Nothing you can do in HTML can force a particular behaviour. Which is a
    good thing as the user probably knows better than you what his
    requirements are, and also what his computer's capabilities are, at any
    given time.

    By configuring your server to send out certain HTTP headers along with
    the file you can increase the chances that the user will be prompted to
    decide what to do with the file. Thus putting an extra step in the way
    of those users who have already configfured their systems correctly.

    Steve
     
    Steve Pugh, Nov 24, 2006
    #3
  4. David

    Andy Dingley Guest

    David wrote:

    > Is there any way with html to put in a link which clicking on will allow a
    > visitor to my site to download a file to their computer


    Why didn't you search for this question first?
     
    Andy Dingley, Nov 24, 2006
    #4
  5. David

    Sid Guest

    On Fri, 24 Nov 2006 09:36:53 -0000, "David" <> wrote:

    : Is there any way with html to put in a link which clicking on will allow a
    : visitor to my site to download a file to their computer to save on their
    : hard drive as opposed to just being displaying in their browser?
    :
    : E.g. to download word .doc files. I want them to be able to click on a link
    : on a webpage and a message to pop up saying do you want to download this
    : file and they can click yes and save it on their computer.
    :


    The easiest way is to zip it. Even grannies now how to unzip these
    days. Or make it a self-executable.

    That way they are forced to download it, and not open/view it.

    Sid
     
    Sid, Nov 24, 2006
    #5
  6. David

    David Guest

    Steve and Dylan many thanks for your helpful explanations.
    What you've said actually makes the problem simpler for me
    because as I don't have any control there is nothing I can do
    except ignore the issue and leave it to the user!



    "Steve Pugh" <> wrote in message
    news:...
    > David wrote:
    >> Is there any way with html to put in a link which clicking on will allow
    >> a
    >> visitor to my site to download a file to their computer to save on their
    >> hard drive as opposed to just being displaying in their browser?

    >
    > Use a normal link.
    >
    >> E.g. to download word .doc files. I want them to be able to click on a
    >> link
    >> on a webpage and a message to pop up saying do you want to download this
    >> file and they can click yes and save it on their computer.

    >
    > <a href="whatever.doc">Whatever</a>
    >
    > What happens when the user clicks on it is entirely up to how the user
    > has their browser configured.
    >
    > Sometimes it will be saved automatically, sometimes it will be opened
    > in Word, sometimes it will be opened by a copy of Word running within
    > the browser, sometimes it cause the user to be asked what to do.
    >
    > And then the user can always over ride their default setting by right
    > clicking on the link and selecting a different option from the context
    > menu.
    >
    > Nothing you can do in HTML can force a particular behaviour. Which is a
    > good thing as the user probably knows better than you what his
    > requirements are, and also what his computer's capabilities are, at any
    > given time.
    >
    > By configuring your server to send out certain HTTP headers along with
    > the file you can increase the chances that the user will be prompted to
    > decide what to do with the file. Thus putting an extra step in the way
    > of those users who have already configfured their systems correctly.
    >
    > Steve
    >
     
    David, Nov 24, 2006
    #6
  7. David

    Dylan Parry Guest

    David wrote:

    > because as I don't have any control there is nothing I can do
    > except ignore the issue and leave it to the user!


    That's often the best way. Rather than "inventing" a problem, just
    pretend it doesn't exist ;)

    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    Programming, n: A pastime similar to banging one's head
    against a wall, but with fewer opportunities for reward.
     
    Dylan Parry, Nov 24, 2006
    #7
  8. David wrote:
    > Is there any way with html to put in a link which clicking on will allow a
    > visitor to my site to download a file to their computer to save on their
    > hard drive as opposed to just being displaying in their browser?
    >
    > E.g. to download word .doc files. I want them to be able to click on a link
    > on a webpage and a message to pop up saying do you want to download this
    > file and they can click yes and save it on their computer.


    It's up to your users whether they want to save it to their hard drives
    (in IE and Firefox, for example, by right-clicking the link and
    selecting the option to save the link's destination). Certainly it can't
    make any difference to you if they want to look at it in their browsers
    and not save it.
     
    Harlan Messinger, Nov 24, 2006
    #8
  9. Sid wrote:
    > On Fri, 24 Nov 2006 09:36:53 -0000, "David" <> wrote:
    >
    > : Is there any way with html to put in a link which clicking on will allow a
    > : visitor to my site to download a file to their computer to save on their
    > : hard drive as opposed to just being displaying in their browser?
    > :
    > : E.g. to download word .doc files. I want them to be able to click on a link
    > : on a webpage and a message to pop up saying do you want to download this
    > : file and they can click yes and save it on their computer.
    >
    > The easiest way is to zip it. Even grannies now how to unzip these
    > days. Or make it a self-executable.
    >
    > That way they are forced to download it, and not open/view it.


    Why would you make your users go through the trouble of saving a ZIP
    file, extracting a Word file from it, and opening the Word file on their
    machine, just to have a look at it?
     
    Harlan Messinger, Nov 24, 2006
    #9
  10. David

    cwdjrxyz Guest

    David wrote:
    > Is there any way with html to put in a link which clicking on will allow a
    > visitor to my site to download a file to their computer to save on their
    > hard drive as opposed to just being displaying in their browser?
    >
    > E.g. to download word .doc files. I want them to be able to click on a link
    > on a webpage and a message to pop up saying do you want to download this
    > file and they can click yes and save it on their computer.


    I use an anonymous ftp link for this sort of thing, especially if the
    download contains a directory of several different types of files.
    Using anonymous ftp avoids bothering the user with a password. On the
    host I use, it is quite easy to set up anonymous ftp from the server
    control panel. Some directories of media files can be rather
    troublesome to download unless you use ftp.
     
    cwdjrxyz, Nov 24, 2006
    #10
  11. David

    Sid Guest

    On Fri, 24 Nov 2006 08:33:58 -0500, Harlan Messinger
    <> wrote:

    : Sid wrote:
    : > On Fri, 24 Nov 2006 09:36:53 -0000, "David" <> wrote:
    : >
    : > : Is there any way with html to put in a link which clicking on will allow a
    : > : visitor to my site to download a file to their computer to save on their
    : > : hard drive as opposed to just being displaying in their browser?
    : > :
    : > : E.g. to download word .doc files. I want them to be able to click on a link
    : > : on a webpage and a message to pop up saying do you want to download this
    : > : file and they can click yes and save it on their computer.
    : >
    : > The easiest way is to zip it. Even grannies know how to unzip these
    : > days. Or make it a self-executable.
    : >
    : > That way they are forced to download it, and not open/view it.
    :
    : Why would you make your users go through the trouble of saving a ZIP
    : file, extracting a Word file from it, and opening the Word file on their
    : machine, just to have a look at it?


    Read the OP's requirements.

    "...to download a file to their computer to save on their hard drive
    as opposed to just being displaying in their browser?"

    You didn't see that??

    Sid
     
    Sid, Nov 24, 2006
    #11
  12. David

    dorayme Guest

    In article <>,
    Harlan Messinger <> wrote:

    > David wrote:
    > > Is there any way with html to put in a link which clicking on will allow a
    > > visitor to my site to download a file to their computer to save on their
    > > hard drive as opposed to just being displaying in their browser?
    > >
    > > E.g. to download word .doc files. I want them to be able to click on a link
    > > on a webpage and a message to pop up saying do you want to download this
    > > file and they can click yes and save it on their computer.

    >
    > It's up to your users whether they want to save it to their hard drives
    > (in IE and Firefox, for example, by right-clicking the link and
    > selecting the option to save the link's destination). Certainly it can't
    > make any difference to you if they want to look at it in their browsers
    > and not save it.



    Sometimes it can make a difference. There are circumstances where
    nearly all the suggestions made in this thread are good. I won't
    go into details because I have noticed no one takes the slightest
    notice of anything I say. I am not complaining. I celebrate this.
    I have worked hard to ensure it. And I congratulate myself.

    --
    dorayme
     
    dorayme, Nov 24, 2006
    #12
  13. David

    Neredbojias Guest

    To further the education of mankind, dorayme
    <> vouchsafed:

    >> It's up to your users whether they want to save it to their hard
    >> drives (in IE and Firefox, for example, by right-clicking the link
    >> and selecting the option to save the link's destination). Certainly
    >> it can't make any difference to you if they want to look at it in
    >> their browsers and not save it.

    >
    >
    > Sometimes it can make a difference. There are circumstances where
    > nearly all the suggestions made in this thread are good. I won't
    > go into details because I have noticed no one takes the slightest
    > notice of anything I say. I am not complaining. I celebrate this.
    > I have worked hard to ensure it. And I congratulate myself.


    Maybe a lot of people actually notice but are too dumbfounded to comment...

    --
    Neredbojias
    Infinity has its limits.
     
    Neredbojias, Nov 25, 2006
    #13
    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. Ryan Taylor
    Replies:
    2
    Views:
    972
    Ryan Taylor
    Nov 10, 2004
  2. Steve C. Orr [MVP, MCSD]
    Replies:
    0
    Views:
    1,636
    Steve C. Orr [MVP, MCSD]
    Mar 7, 2005
  3. Sam --
    Replies:
    2
    Views:
    631
    Sam --
    Mar 17, 2005
  4. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    881
    Kevin Spencer
    May 17, 2005
  5. Rafal Majda
    Replies:
    5
    Views:
    2,327
    Rafal Majda
    Apr 18, 2005
Loading...

Share This Page