Skip to content

Instantly share code, notes, and snippets.

@goldnetonline
Last active May 24, 2016 05:27
Show Gist options
  • Save goldnetonline/a77814e32fd6ceee3d8112d5be9de424 to your computer and use it in GitHub Desktop.
Save goldnetonline/a77814e32fd6ceee3d8112d5be9de424 to your computer and use it in GitHub Desktop.
$file_url = 'http://www.myremoteserver.com/file.exe';
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"" . basename($file_url) . "\"");
readfile($file_url); // do the double-download-dance (dirty but worky)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment