|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13254 Canceld downloaded will end up in browserwindow
Submitted: 2001-09-11 17:11 UTC Modified: 2001-10-19 11:09 UTC
From: php at lucard dot to Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.0.6 OS: Slackware 8.0
Private report: No CVE-ID: None
 [2001-09-11 17:11 UTC] php at lucard dot to
I made a script to start a download of a picture, when u cancel the download and refresh the parent the binary data of the download is displayed in the browser window.

How to reproduce:
- call the script below from a simple HTML page.
- Cancel the download
- refresh the HTML page

Then you will see the binary data of the image ($file). So the $file must be a valid image. <-- for demo 
1.php is the simple html file.... 

header("Content-Type: application/force-download");  
header("Content-Length: " .filesize($file));  
if(preg_match("/MSIE 5.5/", $HTTP_USER_AGENT)) {  
header("Content-Disposition: filename=\"".$file ."\"");  
else {  
header("Content-Disposition: attachment; filename=\"".$file ."\""); 
header("Content-Transfer-Encoding: binary");  



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-12 03:09 UTC] php at lucard dot to
I tested it on 4 different clients same server.
2 give the same problem
2 work perfectly....

Maybe a browser problem?
 [2001-10-19 11:09 UTC]
Unlikely to be a bug in PHP. Unable to reproduce. -> bogus.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 13 23:01:29 2024 UTC