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
2020 Laravel 7 there is a better way:
return response()->download($pathToFile);
I've used this with a file 398mb with no issues, when the same file was causing problems with previous solutions.
From Laravel docs: "The download method may be used to generate a response that forces the user's browser to download the file at the given path. The download method accepts a file name as the second argument to the method, which will determine the file name that is seen by the user downloading the file. Finally, you may pass an array of HTTP headers as the third argument to the method:
return response()->download($pathToFile);
return response()->download($pathToFile, $name, $headers);
return response()->download($pathToFile)->deleteFileAfterSend();
We also have streamed downloads which may suit more: Laravel docs