Skip to content

Instantly share code, notes, and snippets.

@arschmitz
Created October 8, 2015 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arschmitz/6b59eb26be605b6a7db7 to your computer and use it in GitHub Desktop.
Save arschmitz/6b59eb26be605b6a7db7 to your computer and use it in GitHub Desktop.
<?php
if ( !file_exists( "proxy" ) ) {
$filename = "sample.mp3";
file_put_contents( "proxy", "false" );
header( "Cache-Control: no-store, no-cache, must-revalidate, max-age=0" );
header( "Cache-Control: post-check=0, pre-check=0", false);
header( "Pragma: no-cache" );
header('Content-Type: audio/mpeg');
header('Content-Disposition: inline;filename="test.mp3"');
header('Content-length: '.filesize($filename));
header('Cache-Control: no-cache');
header("Content-Transfer-Encoding: binary");
readfile($filename);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment