diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /fs_selfservice/fri/misc/audio.php | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'fs_selfservice/fri/misc/audio.php')
-rw-r--r-- | fs_selfservice/fri/misc/audio.php | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/fs_selfservice/fri/misc/audio.php b/fs_selfservice/fri/misc/audio.php deleted file mode 100644 index 2dc355cb3..000000000 --- a/fs_selfservice/fri/misc/audio.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -/** - * @file - * plays recording file - */ - - - -if (isset($_GET['recording'])) { - - chdir(".."); - include_once("./includes/bootstrap.php"); - - global $ARI_CRYPT_PASSWORD; - - $crypt = new Crypt(); - - $path = $crypt->decrypt($_GET['recording'],$ARI_CRYPT_PASSWORD); - - // strip ".." from path for security - $path = preg_replace('/\.\./','',$path); - - // See if the file exists - if (!is_file($path)) { die("<b>404 File not found!</b>"); } - - // Gather relevent info about file - $size = filesize($path); - $name = basename($path); - $extension = strtolower(substr(strrchr($name,"."),1)); - - // This will set the Content-Type to the appropriate setting for the file - $ctype =''; - switch( $extension ) { - case "mp3": $ctype="audio/mpeg"; break; - case "wav": $ctype="audio/x-wav"; break; - case "Wav": $ctype="audio/x-wav"; break; - case "WAV": $ctype="audio/x-wav"; break; - case "gsm": $ctype="audio/x-gsm"; break; - - // not downloadable - default: die("<b>404 File not found!</b>"); break ; - } - - // need to check if file is mislabeled or a liar. - $fp=fopen($path, "rb"); - if ($size && $ctype && $fp) { - header("Pragma: public"); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); - header("Cache-Control: public"); - header("Content-Description: wav file"); - header("Content-Type: " . $ctype); - header("Content-Disposition: attachment; filename=" . $name); - header("Content-Transfer-Encoding: binary"); - header("Content-length: " . $size); - fpassthru($fp); - } -} - -?>
\ No newline at end of file |