[Home] [My Scripts] [Contact] [Business Card Designer] [Donate] [$8.95 Domain Names]

Home > Scripts > File downloads

File downloads

... feel free to use this script for whatever you like.

File downloads

A short snippet for downloading files.


The following bit of code should cause most browsers to pop up a file download dialog box.<br><br>
To use it, place it in a script then put a link on your webpage pointing to it:


= "name of the file to download";
$filepath = "path/where/file/is/on/server/";

header("Content-type: application/octetstream");
header("Content-Disposition: attachment; filename=$filename");




Note: There should be no blank lines or html outside the php for this script.

[Back] [Top] [Forward]

Powered by php, mySql.

Request processed in 0.01 seconds on Wednesday 26th September 2012 23:43:11.

©2002 Sam Yapp

What do you think of my resume wizard site? All nicely written in php :)