I am using below code to get a MP3 file via PHP. My problem is the MP3 which this code produces is not seeking.
@$filename = $_GET['q'].'.mp3';
if(file_exists($filename)){
header("Content-type: audio/mpeg");
header('Content-length: ' . filesize($filename));
header('Content-Disposition: filename="' . $filename);
header('X-Pad: avoid browser bug');
header('Cache-Control: no-cache');
header('Accept-Ranges: bytes');
readfile($filename);
}else{
header("HTTP/1.0 404 Not Found");
}
It really becomes my headache to find a proper header or another solution to make it possible to seek the MP3.
Thanks for you help in advance.