note 25014 rejected from function.header by betz
| From: | betz@php.net | Date: | Sat, 07 Sep 2002 23:16:21 +0000 |
| Subject: | note 25014 rejected from function.header by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-36319@lists.php.net to get a copy of this message | ||
so far so good. download works. but:
i have a problem that every document i.e.
word document , pdf-file or else is defekt after downloading the file. it is not possible to open
this files after downloading. i do not know where the problem is. is it a problem because of my
operatingsytem (windows xp) or a wrong
configuration of php or just a bug in my php code? who can give me an advice?
here' is my code:
<?PHP
require "..config_mime.php3";
$basedir = "../downloads";
$filename = .....
$save_as_name = ...
$x = filesize($filename);
$ctype = $mimetypes[$ftype];
//build header
header("Cache-Control: private");
header("Content-Type: $ctype");
header("Content-Length: $x");
header("Content-Disposition: attachment; filename= $save_as_name");
readfile(§filename);
?>