php.net |  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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at lucard dot to
New email:
PHP Version: OS:

 

 [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.

http://lucard.no-ip.com/hety/1.php <-- for demo 
1.php is the simple html file.... 

<? 
$file="images/dscf0009.jpg";
$fp=@fopen($file,"r"); 
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");  

fpassthru($fp); 
die(); 
?> 


Patches

Pull Requests

History

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] sander@php.net
Unlikely to be a bug in PHP. Unable to reproduce. -> bogus.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 14:01:30 2024 UTC