My file (126 MB size, .exe) is giving me issues.
I\'m using the standard laravel download method.
I tried increasing the memory but it still either says I ha
I'm using the readfile_chunked()
custom method as stated in php.net here. For Laravel 3, I've extended the response method like this:
Add this file as applications/libraries/response.php
Then comment out this line in application/config/application.php:
'Response' => 'Laravel\\Response',
Example code:
//return Response::download(Config::get('myconfig.files_folder').$file->upload, $file->title);
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$file->title);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . File::size(Config::get('myconfig.files_folder').$file->upload));
ob_clean();
flush();
Response::readfile_chunked(Config::get('myconfig.files_folder').$file->upload);
exit;
Works great so far.