Buenas, estaba mirando el manual y encontre este codigo que como bien dice, puede forsar la descarga de un mp3 y/o evitar que termine en el cache. El problema es que no entiendo muy bien como aplicar el codigo, y quisiera saber si alguien me puede ayudar a enterderlo, quiero saber si realmente funciona pues lo que quiero es evitar que el archivo mp3 quede en el cache, pero no se como va el codigo, yo por el momento lo hago de esta manera:
Código PHP:
Ver original$id = $_GET['id_cancion'];
$sql = ( "select * from archivos WHERE MD5(concat('".$key."',id)) = '$id'");
$ruta = 'CARPETA/' .$row['ruta'];
}
Y este es el codigo que me encontre en el manual:
Código PHP:
Ver originalTo force download an mp3 file and/or prevent the mp3 from ending up in the browser's cache. This is very similiar to mindplay's example below.
<?php
// Only allow mp3 files
$allowedFileType = "mp3";
// Set the filename based on the URL's query string
$theFile = $_REQUEST['theFile'];
// Get info about the file
// Check the extension against allowed file types
// Make sure the file exists
// Set headers
header("Expires: Thu, 19 Nov 1981 08:52:00 GMT"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: private"); header("Content-Transfer-Encoding: binary"); header("Content-Type: audio/x-mpeg, audio/x-mpeg-3, audio/mpeg3"); // This line causes the browser's "save as" dialog
header( 'Content-Disposition: attachment; filename="'.$f['basename'].'"' ); // Length required for Internet Explorer
// Open file
if (($f = fopen($theFile, 'rb')) === false) exit;
// Push file
echo fread($f, (1*(1024*1024))); }
// Close file
?>
bueno, gracias por su ayuda, me gustaria poder resolver esto pronto...