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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
4 + 36 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Mar 29 06:01:29 2024 UTC