php - Laravel 5 file downloads invalid -


when using response::download download files, noticed images , other binary files being transferred incorrectly.

changing content-type header didn't change anything, nor did explicitly disallowing cache or forcing content's length.

what may cause of problem?

the solution problem can found here:

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

the cause of issue due laravel/symfony not cleaning output buffer reason, solution this:

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