Created
June 10, 2014 18:38
-
-
Save frankdejonge/5c19f8e7ce329dbcc1ef to your computer and use it in GitHub Desktop.
Flysystem and user downloads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$stream = $fs->readStream($file); | |
// send the right headers | |
header("Content-Type: " . $fs->getMimetype($file)); | |
header("Content-Length: " . $fs->getSize($file)); | |
header("Content-disposition: attachment; filename=\"" . basename($file) . "\""); | |
// dump the attachement and stop the script | |
fpassthru($stream); | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment