note 42772 added to function.readfile
| From: | davi at lightcomm dot com dot br | Date: | Fri, 28 May 2004 15:08:19 +0000 |
| Subject: | note 42772 added to function.readfile | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70244@lists.php.net to get a copy of this message | ||
Remember to use the @ before the readfile function:
<?php
@readfile("myfile.txt");
?>
instead of
<?php
readfile("myfile.txt");
?>
cos if you ommit the @, and you are forcing a download (with the Header "Content-Disposition:
attachment"), if you get an error, the user will download the error message. I think it is
better to download an empty file than to download an error message instead of the content I wanted.
----
Manual Page -- http://www.php.net/manual/en/function.readfile.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42772
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42772&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42772&report=yes
Search -- http://master.php.net/manage/user-notes.php