Download links

I’m trying to create a professional looking system for clients to download files from. I’ve create a download button with the link:

Download PDF

I’d like it to just present the client with a save now, view now box, however I’m getting a long loading pdf viewer. How do i get away from this or how is it done properly?

You will need to manipulate the header content type in order to tell the browser you want the file to be downloaded instead of viewed. If you are using PHP have a look here to get you pointed in the right direction.

http://stackoverflow.com/questions/1465573/forcing-to-download-a-file-using-php

@JamesKenny ; thanks for this info.

so I created a file called attached.php and put this code inside it

    $fp = @fopen($yourfile, 'rb');

    if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE"))
{
	header('Content-Type: "application/octet-stream"');
	header('Content-Disposition: attachment; filename="yourname.file"');
	header('Expires: 0');
	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
	header("Content-Transfer-Encoding: binary");
	header('Pragma: public');
	header("Content-Length: ".filesize($yourfile));
}
else
{
	header('Content-Type: "application/octet-stream"');
	header('Content-Disposition: attachment; filename="yourname.file"');
	header("Content-Transfer-Encoding: binary");
	header('Expires: 0');
	header('Pragma: no-cache');
	header("Content-Length: ".filesize($yourfile));
}

fpassthru($fp);
fclose($fp);

So where then or how should I place the download link?
many thanks

you would make sure “$yourfile” is the location of the file and then link to the attached.php. The file should stream to the browser. After you get it working I would also play with some of the settings so you have a better idea of what is going on there

just want to say thanks for your help. I sorted it and here is the download page:

Download page

Much appreciated