Skip to content

Instantly share code, notes, and snippets.

@RuanAragao
Created December 24, 2013 13:40
Show Gist options
  • Save RuanAragao/8113520 to your computer and use it in GitHub Desktop.
Save RuanAragao/8113520 to your computer and use it in GitHub Desktop.
$arquivo = $_GET["file"];
if(isset($arquivo) && file_exists($arquivo)){
header("Content-Length: ".filesize($arquivo));
header("Content-Disposition: attachment; filename=".basename($arquivo));
readfile($arquivo);
exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment