Failed to load Laravel 5 file

When using Response::download

to upload files, I noticed that images and other binaries were not transferred correctly.

Changing the title Content-Type

didn't change anything, nor did it explicitly disallow the cache or force the length of the content.

What could be the cause of this problem?

+3


source to share


1 answer


The solution to this problem can be found here:

http://simpledeveloper.com/how-to-fix-laravel-response-image-download-in-laravel/



The cause of the problem was caused by Laravel / Symfony not clearing the output buffer for some reason, so the solution is as follows:

$response = Response::download($path, ...);
ob_end_clean();

return $response;

      

+12


source







All Articles