记录 <?php function downfile() { $filename=realpath("resume.html"); //文件名 $date=date("Ymd-H:i:m"); Header( "Content-type: application/octet-stream "); Header( "Accept-Ranges: bytes "); Header( "Accept-Length: " .filesize($filename)); header( "Content-Disposition: attachment; filename= {$date}.doc"); echo file_get_contents($filename); readfile($filename); } downfile(); ?> 这样在php代码中能够实现推送文件给客户端 Previous 玩转linux之playOnlinux Next java文件流编码 CATALOG FEATURED TAGS Windows Linux MySQL JavaScript Python Caffe Android java php linux React 计算机网络 收藏 Docker Nginx PHP FRIENDS My Github