I am able to serve my mp3 file from a controller, but the file served from my controller will not get played in ios AvPlayer (using url). I\'m sure that my client code is fi
here is the code that worked
$file = storage_path() . '/upload/song/' . $filename;
$mime_type = "audio/mpeg";
$headers = array(
'Accept-Ranges: 0-' . (filesize($file) -1) ,
'Content-Length:'.filesize($file),
'Content-Type:' . $mime_type,
'Content-Disposition: inline; filename="'.$filename.'"'
);
$fileContents = File::get($file);
return Response::make($fileContents, 200, $headers);