Home  >  Article  >  php教程  >  PHP实现下载功能之流程分析

PHP实现下载功能之流程分析

WBOY
WBOYOriginal
2016-06-13 10:17:47731browse

客户端从服务端下载文件的流程分析:

                                                     

 

 

所以我们需要在php代码中设置一次读取的字节数,比如我在下面的代码中通过$buffer=1024设置一次读取的字节数,每读取一次,就输出数据(即返回给浏览器)

 

流程图:

("Content-type:text/html;charset=utf-8" ="圣诞狂欢.jpg" =("utf-8","gb2312",=['DOCUMENT_ROOT']."marcofly/phpstudy/down/down/"=. (!( "没有该文件文件"=(,"r"=( ("Content-type: application/octet-stream"("Accept-Ranges: bytes"("Accept-Length:".("Content-Disposition: attachment; filename=".=1024=0 (!() && =(,+= (?>

 

几点注意事项:

 

  此文章摘自网上,忘大家相互学习。。。

 

 

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn