PHP读取流文件

            $filepath = 'http://www.vip.com/down';
            $fp = fopen($filepath,"r");
            Header("Content-type: application/octet-stream");
            Header("Accept-Ranges: bytes");
            Header("Content-Disposition: attachment; filename=xxx.pdf");
            $buffer = 1024;
            while (!feof($fp)) {
            $file_con = fread($fp,$buffer);
                echo $file_con;
            }
            fclose($fp);    

 

转载于:https://www.cnblogs.com/gide/p/4695529.html

你可能感兴趣的:(PHP读取流文件)