Rumah > Artikel > pembangunan bahagian belakang > 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;