PHP读取流文件
1 <?php 2 $filepath = 'http://www.vip.com/down'; 3 $fp = fopen($filepath,"r"); 4 Header("Content-type: application/octet-stream"); 5 Header("Accept-Ranges: bytes"); 6 Header("Content-Disposition: attachment; filename=xxx.pdf"); 7 $buffer = 1024; 8 while (!feof($fp)) { 9 $file_con = fread($fp,$buffer); 10 echo $file_con; 11 } 12 fclose($fp);