From f92752b3580cf25af6f64691be6a80dc91ef641f Mon Sep 17 00:00:00 2001 From: stan Date: Sun, 6 Feb 2011 16:52:10 +0000 Subject: [PATCH] Added more content headers for video download. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3288 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/skins/classic/views/video.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/skins/classic/views/video.php b/web/skins/classic/views/video.php index 263b5ea3b..80578fc76 100644 --- a/web/skins/classic/views/video.php +++ b/web/skins/classic/views/video.php @@ -88,7 +88,15 @@ if ( isset($_REQUEST['deleteIndex']) ) if ( isset($_REQUEST['downloadIndex']) ) { $downloadIndex = validInt($_REQUEST['downloadIndex']); - header( "Content-disposition: attachment; filename=".$videoFiles[$downloadIndex]."; size=".filesize($videoFiles[$downloadIndex]) ); + header( "Pragma: public" ); + header( "Expires: 0" ); + header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" ); + header( "Cache-Control: private", false ); // required by certain browsers + header( "Content-Description: File Transfer" ); + header( 'Content-disposition: attachment; filename="'.basename($videoFiles[$downloadIndex]).'"' ); // basename is required because the video index contains the path and firefox doesn't strip the path but simply replaces the slashes with an underscore. + header( "Content-Transfer-Encoding: binary" ); + header( "Content-Type: application/force-download" ); + header( "Content-Length: ".filesize($videoFiles[$downloadIndex]) ); readfile( $videoFiles[$downloadIndex] ); exit; }