Hi there,
Sorry if I'm asking a simple question but I am a little confused! 🙂
I have been searching though the Evolt archives and have come across this snippet by Kris Headstrom with a solution, but I don't know how to actually implement it. Can anyone help me please?
This is the original link: http://lists.evolt.org/archive/Week-of-Mon-20011224/064591.html and here is the code:
<?php
function download($path)
global $HTTP_USER_AGENT;
$file=basename($path);
$size = filesize($path);
header("Content-Type: application/octet-stream");
header("Content-Type: application/force-download");
header("Content-Length: $size");
// IE5.5 just downloads index.php if we don't do this
if(preg_match("/MSIE 5.5/", $HTTP_USER_AGENT))
header("Content-Disposition: filename=$file");
} else
header("Content-Disposition: attachment;
filename=$file");
}
header("Content-Transfer-Encoding: binary");
$fh = fopen($path, "r");
fpassthru($fh);
}
?>
Thanksa lot