Re: File download problem
| From: | Ashley Sheridan | Date: | Mon, 18 Aug 2008 14:15:42 +0000 |
| Subject: | Re: File download problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-278277@lists.php.net to get a copy of this message | ||
Hi Stefano,
You can use this code instead to read in the file and output it to the
browser, as it is binary safe. I've used it for the same reason you
require, and it works fine with video clips.
$fp = fopen($path, "rb");
while(!feof($fp))
{
print(fread($fp, 1024));
flush($fp);
}
fclose($fp);
exit();
The "rb" in the fopen function instructs PHP to open the file for
reading in a binary safe manner.
Hope this helps.
Ash
www.ashleysheridan.co.uk