View Full Version : HTML Code for downloading files
02-07-2005, 02:26 AM
I am designing a web site, and I want the users to be able to download various files i.e. in word, powerpoint or (most likely) PDF format.
It seems to be a commonly used feature on many sites, but how do I code it in HTML?
Grateful for any examples you can come up with!
02-07-2005, 05:12 AM
02-07-2005, 10:22 AM
<a href=" file.pdf">Some PDF file</a> Is this what your after or is it more complicated?? :hellother
Download Instruction page (http://tmckee.freeserverhost.com/swf/download.html) :hellother
02-07-2005, 06:44 PM
Moose man - I don't know whether to give you karma or take it away for being such a cheeky bugger. That does get the point across but I don't think I can use it with a bunch of overly serious academics.
02-07-2005, 07:06 PM
11-09-2005, 06:23 AM
The best way to be sure that user will get a download dialog and Adobe Reader will not catch up ur file, is to use a simple PHP script. it forces the browser to open download dialog.
$file = $_GET['file'];
header("Content-Disposition: attachment; filename=". $file);
and use this link:
<a href="path_to.php?file=file_name">File Name</a>
06-21-2007, 09:48 PM
I'm trying to use your code to allow users to download video and sound files but can't seem to get the php code to work to allow left click to cause dialog to open.
let's say the file is called space_noise.mp3 Would you mind inserting it properly in the above .pdf example
much thanks in advance. I've been looking all around for this.
06-22-2007, 08:15 AM
Are you wanting them to force download and open in media player or just to get the mp3?
Do you have your files in the php extension and does your host support php?
07-09-2007, 05:01 PM
I am pretty new here, but to answer your question: If you zip the files first then link to it. I think that should automatically make a download available. I haven't tried this but read it off some other site.
I am sorry if this doesn't help.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.