note 33547 added to function.header

From: Date: Mon, 30 Jun 2003 11:51:31 +0000
Subject: note 33547 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-51205@lists.php.net to get a copy of this message
just a quicky, but this baffled me for ages. If you are outputting a file don't forget to add a new line between you header and file. Like this:- $header = "application/vnd.ms-powerpoint"; header("Content-type: $header"); header("Content-Length: ".filesize(FILE_PATH.$file)); header("Content-Disposition: attachment; filename=$file"); echo "\\n"; readfile(FILE_PATH.$file); If you don't the browser spits out a bunch of junk. chris :) ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33547 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33547&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33547&report=yes

« previous php.notes (#51205) next »