Last active
October 19, 2017 09:04
-
-
Save tenomoto/9aadc4cbb6083b68a5681c6503367831 to your computer and use it in GitHub Desktop.
X-SendFile
This file contains hidden or 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
# pkg add the following line. uncomment it to enable mod_xsendfile | |
LoadModule xsendfile_module libexec/apache24/mod_xsendfile.so | |
# turn XSendFile on and specifiy the path | |
XSendFile On | |
XSendFilePath /usr/local/www/xsendfilepath |
This file contains hidden or 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 | |
$filepath = "/usr/local/www/xsendfilepath/xsendfile.pdf"; | |
header('Content-Type: application/pdf'); | |
header('Content-Size: '.filesize($filepath)); | |
header('X-Sendfile: '.$filepath); | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment