I need to programmatically initiate file downloads using PHP along with resume-support
These files are heavy. So IO buffering like below or caching is not an option
$content=file_get_contents($file);
header("Content-type: application/octet-stream");
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header("Content-Length: ". filesize($file));
echo $content;
The only viable option I found so far is the Apache module X-sendfile. Unfortunately our hosting service won't install mod_xsendfile
- so we are looking for other hosting providers, but that's another story.
We are using LAMP and the yii framework. What are possible alternatives?