forked from extern/egroupware
Modify content_header() to take mime type and nocache
This commit is contained in:
parent
713272f9d2
commit
fb487058fe
@ -221,7 +221,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Echo content headers for file downloads
|
// Echo content headers for file downloads
|
||||||
function content_header($fn="")
|
function content_header($fn="",$mime="application/octetstream",$nocache=True)
|
||||||
{
|
{
|
||||||
if ($fn)
|
if ($fn)
|
||||||
{
|
{
|
||||||
@ -233,11 +233,17 @@
|
|||||||
{
|
{
|
||||||
$attachment = " attachment;";
|
$attachment = " attachment;";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show this for all
|
||||||
header('Content-disposition:'.$attachment.' filename="'.$fn.'"');
|
header('Content-disposition:'.$attachment.' filename="'.$fn.'"');
|
||||||
header('Content-type: application/octetstream');
|
header('Content-type: '.$mime);
|
||||||
|
|
||||||
|
if ($nocache)
|
||||||
|
{
|
||||||
header('Pragma: no-cache');
|
header('Pragma: no-cache');
|
||||||
header('Expires: 0');
|
header('Expires: 0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user