Home > Backend Development > PHP Tutorial > PHP 下载时网页没法执行其他动作

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

WBOY
Release: 2016-06-13 12:43:55
Original
1156 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 admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template