Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/12/2011, 17:55
Fabih24
 
Fecha de Ingreso: mayo-2010
Mensajes: 66
Antigüedad: 14 años
Puntos: 2
Respuesta: descargar archivos mp3

Ya lo encontre se hace através de PHP, por si a alguien le sirve dejo el código que encontre

index.html
Código HTML:
Ver original
  1. <title>test</title>
  2. </head>
  3. <a href="DOWNLOAD_MP3.PHP?mp3=Rom1_1.mp3">Download Romans 1:1</a>
  4. </body>
  5. </html>

DOWNLOAD_MP3.php
Código PHP:
<?php
//If the mp3 posted variable is blank or too big (hacking attempt) 
//send them to the home page...
if ( (!isset($_GET["mp3"])) || (strlen($_GET["mp3"]) > 100) ) {
header("Location: http://www.example.com/index.php");

} else {
//if there is a posted Mp3 set then do this...

$mp3Name trim(addslashes(strip_tags($_GET["mp3"]))); //which would be "Rom1_1.mp3"
$filename "Romans/$mp3Name";

header("Content-Length: " filesize($filename));
header('Content-Type: audio/mpeg');
header("Content-Disposition: attachment; filename= $mp3Name");

readfile($filename);
?>