[PHP] Download files probleem

Pagina: 1
Acties:

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

ontbrakt
wat was de vraag?

Doet iets met Cloud (MS/IBM)


  • LuCarD
  • Registratie: Januari 2000
  • Niet online

LuCarD

Certified BUFH

Topicstarter
Ik heb een script gemaakt die een download forceert. Maar als je de download cancelt en de pagina refresht waar hij vandaan kwam dan geeft hij de binary data in de browser window. :? :? :? :?
En dat wou ik graag anders zien. Iemand een idee?

Ik maak gebruik van het onderstaande script.
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?
$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(); 
?>

http://lucard.no-ip.com/hety/1.php

Programmer - an organism that turns coffee into software.