Skip to content
Snippets Groups Projects
Commit 5494bd2e authored by nandXor's avatar nandXor
Browse files

return stream instead of http header redirect

parent f848f00c
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,10 @@ $random_number = rand(0, $files_count - 1); ...@@ -11,7 +11,10 @@ $random_number = rand(0, $files_count - 1);
$random_file = $DIR . '/' . $files[$random_number]; $random_file = $DIR . '/' . $files[$random_number];
// Redirect // Redirect
header("Location: " . $random_file); header('Content-Type: audio/mpeg');
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"" . $random_file . "\"");
readfile($random_file);
die(); die();
?> ?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment