I have created an MP3 download app from mysql. It plays the song fine. :)
Only problem is that when it downloads, all the header information, like song lyrics, credits and album cover have all disappeared. :mad: When I open the file in a text editor, the information is there, but there's lots of whitespace between it and the top of the file. Here' my php header stuff, data0 is the file data.
$data0 = base64_decode($ d);
//$data1 =header("Conten t-type: application/force-download")."\n" ;
$data1 .=header("Conte nt-type: audio/mpeg;\r\n");
$data1 .=header("Conte nt-Disposition: attachment; filename=\"".$t itle."\"")."\n" ;
$data1 .=header('Conte nt-Transfer-Encoding: binary');
$data1 .=header("Conte nt-Length: ".strlen($d)."" )."\n";
$data2 = $data1.trim($da ta0);
echo$data2;
How do I preserve the header info so that it is recognizable by mp3 players? :confused:
Any thoughts?
Only problem is that when it downloads, all the header information, like song lyrics, credits and album cover have all disappeared. :mad: When I open the file in a text editor, the information is there, but there's lots of whitespace between it and the top of the file. Here' my php header stuff, data0 is the file data.
$data0 = base64_decode($ d);
//$data1 =header("Conten t-type: application/force-download")."\n" ;
$data1 .=header("Conte nt-type: audio/mpeg;\r\n");
$data1 .=header("Conte nt-Disposition: attachment; filename=\"".$t itle."\"")."\n" ;
$data1 .=header('Conte nt-Transfer-Encoding: binary');
$data1 .=header("Conte nt-Length: ".strlen($d)."" )."\n";
$data2 = $data1.trim($da ta0);
echo$data2;
How do I preserve the header info so that it is recognizable by mp3 players? :confused:
Any thoughts?
Comment