note 18265 added to function.fpassthru

From: Date: Wed, 16 Jan 2002 16:34:08 +0000
Subject: note 18265 added to function.fpassthru
Groups: php.notes 
Request: Send a blank email to php-notes+get-24913@lists.php.net to get a copy of this message
To display a "Save as..." box which displays the name of the file you're sending to the user: <? $completeFilePath=$fileDir.'/'.$fileName; header('Cache-Control: no-cache, must-revalidate'); header('Pragma: no-cache'); header("Content-type: application/octet-stream\nContent-Disposition: inline; filename=\"".$fileName."\"\nContent-length: ".(string)(filesize($completeFilePath))); $fd=fopen($completeFilePath,'r'); fpassthru($fd); ?> The first two header calls are only needed to make sure the client doesn't cache the document. -- http://www.php.net/manual/en/function.fpassthru.php http://master.php.net/manage/user-notes.php?action=edit+18265 http://master.php.net/manage/user-notes.php?action=delete+18265 http://master.php.net/manage/user-notes.php?action=reject+18265

« previous php.notes (#24913) next »