diff options
author | Andrew Dolgov <[email protected]> | 2018-08-16 12:16:51 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-08-16 12:16:51 +0300 |
commit | 88adf3da1b8ed0ecc3bb17d34d2322e344cb06a6 (patch) | |
tree | d07010d96be07a8a92c6042fa2de791e9d9d5e79 /include/functions.php | |
parent | 163b50b15f3b163a392327692aede68e31a6204e (diff) |
send_local_file: add application/octet-stream hack
cached_url: return original requested filename to save as
Diffstat (limited to 'include/functions.php')
-rwxr-xr-x | include/functions.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/functions.php b/include/functions.php index 7ebbe38b3..b6e49716c 100755 --- a/include/functions.php +++ b/include/functions.php @@ -2574,6 +2574,13 @@ } $mimetype = mime_content_type($filename); + + // this is hardly ideal but 1) only media is cached in images/ and 2) seemingly only mp4 + // video files are detected as octet-stream by mime_content_type() + + if ($mimetype == "application/octet-stream") + $mimetype = "video/mp4"; + header("Content-type: $mimetype"); $stamp = gmdate("D, d M Y H:i:s", filemtime($filename)) . " GMT"; |