Set filename so that save as gives the correct filename

pull/1857/head
Isaac Connor 2017-04-19 13:11:15 -04:00
parent c80c02ea00
commit 8fbe765a7d
1 changed files with 9 additions and 1 deletions

View File

@ -35,6 +35,8 @@ require_once('includes/Event.php');
$errorText = false; $errorText = false;
$path = ''; $path = '';
$Event = null;
if ( ! empty($_REQUEST['eid'] ) ) { if ( ! empty($_REQUEST['eid'] ) ) {
$Event = new Event( $_REQUEST['eid'] ); $Event = new Event( $_REQUEST['eid'] );
$path = $Event->Path().'/'.$Event->DefaultVideo(); $path = $Event->Path().'/'.$Event->DefaultVideo();
@ -73,10 +75,16 @@ if ( isset( $_SERVER['HTTP_RANGE'] ) ) {
} }
} # end if HTTP_RANGE } # end if HTTP_RANGE
header('Content-type: video/mp4'); header('Content-type: video/mp4');
header('Accept-Ranges: bytes'); header('Accept-Ranges: bytes');
header('Content-Length: '.$length); header('Content-Length: '.$length);
header("Content-Disposition: inline;"); # This is so that Save Image As give a useful filename
if ( $Event ) {
header('Content-Disposition: inline; filename="' . $Event->DefaultVideo() . '"');
} else {
header("Content-Disposition: inline;");
}
if ( $begin > 0 || $end < $size-1 ) { if ( $begin > 0 || $end < $size-1 ) {
header('HTTP/1.0 206 Partial Content'); header('HTTP/1.0 206 Partial Content');
header("Content-Range: bytes $begin-$end/$size"); header("Content-Range: bytes $begin-$end/$size");