forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
35 lines
1.1 KiB
<?php |
|
|
|
/* |
|
* To change this template, choose Tools | Templates |
|
* and open the template in the editor. |
|
*/ |
|
$fileExist = 0; |
|
$tpLayout = 1; |
|
$path_som = $_SESSION["path_som"]; |
|
$get = explode('.', $_GET["audioIndisp"]); |
|
$file = $get[0] . ".mp3"; |
|
$fileDisp = $file; |
|
$filepath = VerificaCharFinal($path_som) . GetDirArqSom($dbcon) . $file; |
|
$fileExist = @file_exists($filepath); |
|
|
|
|
|
|
|
if (!$fileExist) { |
|
$jsStartup[] = "alert('Arquivo não encontrado!'); window.close();"; |
|
} else { |
|
ob_clean(); |
|
header("Pragma: public"); |
|
header('Cache-Control: no-cache, must-revalidate'); |
|
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
|
//header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime( $filepath )) . ' GMT'); |
|
header('Accept-Ranges: bytes'); |
|
header('Content-Type: ' . GetMimeContentType($fileDisp)); |
|
header('Content-Disposition: attachment; filename="' . $fileDisp . '";'); |
|
header('Content-Transfer-Encoding: binary'); |
|
header('Content-Length: ' . filesize($filepath)); |
|
header('Connection: close'); |
|
readfile($filepath); |
|
exit; |
|
} |
|
?>
|
|
|