X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fplatal.inc.php;h=6b28abb64a4646180a9b300c09eaf1c8a7893bdb;hb=bdcf4c153ff7bc5fc18dd828bc3d12519b7c719c;hp=f9bf12717e1e1486917d88c4e9dd13b6e831cab7;hpb=13cec5adcabc015959a87a75ef67cc354242a6bd;p=platal.git diff --git a/include/platal.inc.php b/include/platal.inc.php index f9bf127..6b28abb 100644 --- a/include/platal.inc.php +++ b/include/platal.inc.php @@ -261,7 +261,7 @@ function pl_content_headers($content_type, $encoding = 'utf-8') * cache duration defaults to the global static_cache_duration. No encoding is * applied by default. */ -function pl_cached_content_headers($content_type, $encoding = null, $cache_duration = -1) +function pl_cached_content_headers($content_type, $encoding = null, $cache_duration = -1, $filename = null) { global $globals; $cache_duration = ($cache_duration < 0 ? $globals->static_cache_duration : $cache_duration); @@ -270,6 +270,9 @@ function pl_cached_content_headers($content_type, $encoding = null, $cache_durat header("Expires: " . gmdate('D, d M Y H:i:s', time() + $cache_duration) . " GMT"); header("Pragma: "); pl_content_headers($content_type, $encoding); + if (!is_null($filename)) { + header('Content-Disposition: attachment; filename=' . $filename); + } } /**