note 84755 added to function.readfile
| From: | jtgrant at gmail dot com | Date: | Mon, 28 Jul 2008 20:46:52 +0000 |
| Subject: | note 84755 added to function.readfile | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-142871@lists.php.net to get a copy of this message | ||
FIREFOX will recognize an absolute HTTP://www.site.com/path/file.pdf
OTHER BROWSERS WILL NOT.
use relative: 'path/file.pdf'
for downloading files/pdfs:
make certain to check
if(file_exists($file)){header('Content-Disposition: attachment;
filename="'.basename($file).'"');}
else{echo "$file not found";}
- This can be frustrating when your downloads are working in Firefox , but not other browsers.
Best to check if file exists first because that will let you know if it's going to work all
around.
----
Server IP: 64.71.164.2
Probable Submitter: 66.185.170.90
----
Manual Page -- http://www.php.net/manual/en/function.readfile.php
Edit -- https://master.php.net/note/edit/84755
Del: integrated -- https://master.php.net/note/delete/84755/integrated
Del: useless -- https://master.php.net/note/delete/84755/useless
Del: bad code -- https://master.php.net/note/delete/84755/bad+code
Del: spam -- https://master.php.net/note/delete/84755/spam
Del: non-english -- https://master.php.net/note/delete/84755/non-english
Del: in docs -- https://master.php.net/note/delete/84755/in+docs
Del: other reasons-- https://master.php.net/note/delete/84755
Reject -- https://master.php.net/note/reject/84755
Search -- https://master.php.net/manage/user-notes.php