* file extension (e.g. map mp3 files to audio/mpeg). */ private function getContentType($fileType) { $contentType = 'audio/'; switch (strtolower($fileType)) { case 'mp3': $contentType .= 'mpeg'; break; case 'm4a': $contentType .= 'm4a'; break; case 'ogg': $contentType .= 'ogg'; break; default: die('Unknown file extension. Cannot determine content type.'); break; } return $contentType; } } // Get sample ID from HTTP GET $sampleID = ''; if (!empty($_GET['sid'])) { $sampleID = $_GET['sid']; } // Download file $downloadManager = new DownloadManager(); $downloadManager->fetchSample($sampleID);