Added more content headers for video download.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3288 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2011-02-06 16:52:10 +00:00
parent 162b1b2feb
commit f92752b358
1 changed files with 9 additions and 1 deletions

View File

@ -88,7 +88,15 @@ if ( isset($_REQUEST['deleteIndex']) )
if ( isset($_REQUEST['downloadIndex']) ) if ( isset($_REQUEST['downloadIndex']) )
{ {
$downloadIndex = validInt($_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] ); readfile( $videoFiles[$downloadIndex] );
exit; exit;
} }