PHP 下载时网页没法执行其他动作

WBOY
Release: 2016-06-13 11:25:49
Original
746 people have browsed it

PHP 下载时网页无法执行其他动作
我有一个页面是下载的,代码如下
Header ( 'Cache-Control: no-cache, must-revalidate' );
Header ( 'Content-type: application/octet-stream' );
Header ( 'Accept-Ranges: bytes' );
Header ( 'Content-Length:'.$this->_filesizebytes );
Header ( 'Content-Disposition: attachment; filename="'.$this->_filename.'"' );
$file = fopen ( $this->_fileFullPath, "r" );
$buffer = round(1024);
while ( ! feof ( $file ) ) {
  echo fread ( $file, $buffer );
  flush();
}
fclose ( $file );
问题是当我执行下载的同时再做其他动作的时候,就会停止响应,然后等文件下载完毕后再执行操作,在本地或者远端服务器都是这样,请问这是为什么呀?
谢谢

PHP 服务器 Buffer
Related labels:
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!