php文件输出

Header("Content-type: application/octet-stream");
Header("Content-Disposition: attachment; filename=log.txt");
$filename = '/proj/logs/log.txt';
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo $contents;
die;


你可能感兴趣的:(php文件输出)