Add content length setting

This commit is contained in:
Miles Lott 2001-04-13 05:34:46 +00:00
parent fb487058fe
commit bee99d173e

View File

@ -221,7 +221,7 @@
}
// Echo content headers for file downloads
function content_header($fn="",$mime="application/octetstream",$nocache=True)
function content_header($fn="",$mime="application/octetstream",$length="",$nocache=True)
{
if ($fn)
{
@ -238,6 +238,11 @@
header('Content-disposition:'.$attachment.' filename="'.$fn.'"');
header('Content-type: '.$mime);
if ($length)
{
header("Content-length: ".$length);
}
if ($nocache)
{
header('Pragma: no-cache');