I’m trying to retrieve an mp3 file that is above the root level to play it in a flash button. This is the script I have so far. It is returning an empty file.
Any ideas?
Thanks E
<?php
if ($_GET['password']!='password'){ exit; }
$filepath=$_GET['song'];
if (!file_exists($filepath)){ echo "no file exists"; exit();}
header('Content-Type: audio/mpeg');
header('Content-Disposition: attachment; filename="song.mp3"');
readfile($filePath) or die('could not read file');
?>