I have this code triggered when user download mp3 file
$file = $_GET['file'];
$ext = pathinfo($file, PATHINFO_EXTENSION);
$match_array =array('pdf','mp3','mpa','ra','wav','wma','mid','m4a','m3u','iff','aif');
if(in_array($ext,$match_array)){
header("Content-type: application/".$ext);
header("Content-Disposition: attachment; filename=". $file);
readfile($file);
}
but downloaded file is 0 byte so what is the problem ?
File exists and $file
contain this value
https://mysite/upload/1/myfile.mp3