PHP实现文件下载
<?php $FilePath = 'abc.txt'; $file = fopen("php://output", 'w');
Header("Content-type: application/octet-stream"); Header("Accept-Ranges: bytes"); Header("Accept-Length: ".filesize('abc.txt')); Header("Content-Disposition: attachment; filename=".'abc.txt'); echo fread($file, filesize($FilePath)); fclose($file);