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

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

WBOY
Release: 2016-06-13 10:17:47
Original
822 people have browsed it

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

                                                     

 

 

所以我们需要在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 (!() && =(,+= (?>

 

几点注意事项:

 

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

 

 

 

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template