Whats wrong with this code?
Posted: Mon Jun 09, 2003 11:09 am
Here is a file I use to let the user download a file:
This code works perfectly fine in Mozilla 1.3, but doesn't in IE 5.x . I tried adding quotes to the filename ( ... filename =\"".$filename."\" .....), and it still wouldn't work in IE, but did with Mozilla.
Anybody know how to make it work in IE?
Code: Select all
<?
//File: getfile.php
$filename = "gets_filename_from_database"; //ex: blah.zip
$filelocation = "gets_from_database"; //ex: ../blah.zip
header("Content-type: application/download");
header("Content-disposition: attachment; filename=".$filename);
readfile($filelocation);
?>Anybody know how to make it work in IE?