Page 1 of 1

hyperlink to download?

Posted: Tue Jan 10, 2006 5:34 am
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

Posted: Tue Jan 10, 2006 5:51 am
by foobar

Code: Select all

<a href="path/to/file.bar">Download file.bar</a>';
Done.

Posted: Tue Jan 10, 2006 6:01 am
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.

Posted: Tue Jan 10, 2006 9:03 am
by feyd
search for force download

Posted: Tue Jan 10, 2006 10:10 am
by Chris Corbyn
feyd wrote:search for force download
and the extend on that...

Hint:

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