hyperlink to download?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
saumya
Forum Contributor
Posts: 193
Joined: Sun Jan 30, 2005 10:21 pm

hyperlink to download?

Post by saumya »

can anybody here help me with a script, which will download a file from my server??
I want a hyperlink text which when clicked should download a file.

thanking you
saumya
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

Code: Select all

<a href="path/to/file.bar">Download file.bar</a>';
Done.
saumya
Forum Contributor
Posts: 193
Joined: Sun Jan 30, 2005 10:21 pm

Post by saumya »

thank you verymuch.
But i am trying to download an xsl file.Which is windows Excel sheet.Instead of opening up the download dialogue box it open up in ie.anyway i can stop opening in internet explorer and force to save the file or download the file.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

search for force download
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

feyd wrote:search for force download
and the extend on that...

Hint:

fread(), header() [Content-type, Content-disposition, Content-length]
Post Reply