码迷,mamicode.com
首页 > Web开发 > 详细

PHP读取流文件

时间:2015-08-02 13:22:36      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:

            $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);    

 

PHP读取流文件

标签:

原文地址:http://www.cnblogs.com/gide/p/4695529.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!