note 53689 deleted from function.fpassthru by nlopess
| From: | nlopess@php.net | Date: | Thu, 09 Jun 2005 15:52:41 +0000 |
| Subject: | note 53689 deleted from function.fpassthru by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-90182@lists.php.net to get a copy of this message | ||
Note Submitter: sneha_bhojappa at yahoo dot com
----
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.