note 53690 added to function.fpassthru
| From: | sneha_bhojappa at yahoo dot com | Date: | Thu, 09 Jun 2005 11:10:38 +0000 |
| Subject: | note 53690 added to function.fpassthru | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90168@lists.php.net to get a copy of this message | ||
I am trying to write a php code to download files from server.
Here is the code :
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Length: $size');
header("Content-Type: application/download");
header("Content-Type: $type");
header('Content-Disposition: attachment; filename="' . basename($filename) .
'"');
readfile($file);
The file gets downloaded but the downloaded file size is ZERO ie the file downloaded is empty.
Can anybody tell what the problem is ?
Thanks in advance,
Sneha
----
Manual Page -- http://www.php.net/manual/en/function.fpassthru.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53690
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53690&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53690&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53690&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53690&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53690&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53690&report=yes
Search -- http://master.php.net/manage/user-notes.php