error handling - PHP return mp3 file -


hello guys!

i have little music app files loaded url "http://www.mymusicapp.com/get_song.php?name=some_music". locally app works fine! but, when put on server app generate error in browser console.

browser error uncaught invalidstateerror: attempt made use object not, or no longer, usable

my php code is...

 $song_name = $_get['name'];  $song_file = "{$_server['document_root']}/assets/musics/{$song_name}.mp3";   if( file_exists( $song_file ) )  {       header("content-type: audio/mpeg, audio/x-mpeg, audio/x-mpeg-3, audio/mpeg3");       header('content-length: ' . filesize($song_file));       header('content-disposition: attachment; filename="'.$song_name.'.mp3"');       header("content-transfer-encoding: binary");             header('x-pad: avoid browser bug');               readfile( $song_file );        }      


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -