Other actions cannot be performed on the web page during PHP download.

Source: Internet
Author: User
Tags php server php download
During PHP download, the webpage cannot perform other operations. I have a page for download. the code is as follows: Header & nbsp; (& nbsp; 'cache-Control: & nbsp; no-Cache, & nbsp; must-revalidate '& nbsp;); Header & nbsp; (& n other actions cannot be performed on the webpage during PHP download
I have a page to download. the code is as follows:
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 = fig (1024 );
While (! Feof ($ file )){
Echo fread ($ file, $ buffer );
Flush ();
}
Fclose ($ file );
The problem is that when I perform the download and other actions, the response will be stopped, and then the operation will be executed after the file download is complete. this is the case on the local or remote server, why?
Thank you.
PHP server Buffer shared:
------ Solution --------------------
If the session is not used, it will not happen.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.