note 85287 added to function.readfile
| From: | cealtoca at osu1 dot php dot net | Date: | Sat, 23 Aug 2008 19:58:52 +0000 |
| Subject: | note 85287 added to function.readfile | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143775@lists.php.net to get a copy of this message | ||
My hosting server switched to php5 and now my download script doesn't work, just shows binary
code of my file instead of download
script:
<?php
$url = '/relative/path/'.$nombre2;
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Length: ' . filesize($url));
header('Content-Disposition: attachment; filename=' . basename($url));
readfile($url);
?>
Any ideas ?
----
Server IP: 69.147.83.197
Probable Submitter: 189.147.90.67
----
Manual Page -- http://www.php.net/manual/en/function.readfile.php
Edit -- https://master.php.net/note/edit/85287
Del: integrated -- https://master.php.net/note/delete/85287/integrated
Del: useless -- https://master.php.net/note/delete/85287/useless
Del: bad code -- https://master.php.net/note/delete/85287/bad+code
Del: spam -- https://master.php.net/note/delete/85287/spam
Del: non-english -- https://master.php.net/note/delete/85287/non-english
Del: in docs -- https://master.php.net/note/delete/85287/in+docs
Del: other reasons-- https://master.php.net/note/delete/85287
Reject -- https://master.php.net/note/reject/85287
Search -- https://master.php.net/manage/user-notes.php