Created
August 20, 2015 03:36
-
-
Save GerBawn/7ea34873beb0901ed9cd to your computer and use it in GitHub Desktop.
php提供文件下载
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 | |
$file = "/tmp/dummy.tar.gz"; | |
header("Content-type: application/octet-stream"); | |
header('Content-Disposition: attachment; filename="' . basename($file) . '"'); | |
header("Content-Length: ". filesize($file)); | |
readfile($file); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment