Hola foreros.
Tengo un problemilla y espero puedan ayudarme. Agradezco la colaboración de antemano.
El caso es que necesito descargar canciones mp3 y que cada descarga se contabilice en un contador. Lo he programado pero a la hora de abrir la canción no se abre el reproductor de audio sino que muestra los caracteres del archivo y da errores.
este es el codigo de las header dentro de contador.php
$path_a_tu_doc="../FileUpload/archivos/";
$enlace = $path_a_tu_doc."/".$archivo;
header ("Content-Disposition: attachment; filename=".$_GET["archivo"]); /*linea17*/
header ("Content-Type: application/mp3");/*linea18*/
header ("Content-Length: ".filesize($enlace));/*linea19*/
readfile($enlace);
el error que da es este:
Warning: Cannot modify header information - headers already sent by (output started at /home/johnsto2/public_html/audio-video/audio-video-contador.php:1) in /home/johnsto2/public_html/audio-video/audio-video-contador.php on line 17
Warning: Cannot modify header information - headers already sent by (output started at /home/johnsto2/public_html/audio-video/audio-video-contador.php:1) in /home/johnsto2/public_html/j-music.es/audio-video/audio-video-contador.php on line 18
Warning: Cannot modify header information - headers already sent by (output started at /home/johnsto2/public_html/audio-video/audio-video-contador.php:1) in /home/johnsto2/public_html/j-music.es/audio-video/audio-video-contador.php on line 19
ID3TSSE Lavf52.39.0ÿûdði ¤ 4€LAME3UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU.98UUUUUÿ û’dÿði ¤ 4€ 6’A@ “4€P@ ' €$ d @(adä€ PI'@$ÅÂà˜ #˜Œ @©:0¸œP(È'# £:JŠÉÂá´dtb°LV+oØ*\6+'Ù®FÉÈÍp6#æ+Xÿû’dÿði ¤ 4€Âà˜¬.N´‰Á1X¬Ü䀀‚m£Ið˜h»D” Ãm£H‘PHFO… €Â@\&@H
¿saben cual puede ser el error?