note 25014 added to function.header

From: Date: Sat, 07 Sep 2002 20:54:50 +0000
Subject: note 25014 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-36313@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); ?> -- http://www.php.net/manual/en/function.header.php http://master.php.net/manage/user-notes.php?action=edit+25014 http://master.php.net/manage/user-notes.php?action=delete+25014 http://master.php.net/manage/user-notes.php?action=reject+25014

« previous php.notes (#36313) next »