note 33547 deleted from function.header by sniper

From: Date: Sun, 07 Sep 2003 21:47:29 +0000
Subject: note 33547 deleted from function.header by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55657@lists.php.net to get a copy of this message
Note Submitter: chris@stickee.co.uk ---- 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 :)

« previous php.notes (#55657) next »