|
Posted by Steve Pugh on 11/24/06 09:45
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
Navigation:
[Reply to this message]
|