From 5ae65d532986b9a977b319f10f414d37c16b306c Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 21 Oct 2020 13:32:46 -0700 Subject: [PATCH] Fixed #8566 - PDF files displaying as ascii instead of downloading --- app/Http/Controllers/Licenses/LicenseFilesController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Licenses/LicenseFilesController.php b/app/Http/Controllers/Licenses/LicenseFilesController.php index cfa11609ff..817fbb3290 100644 --- a/app/Http/Controllers/Licenses/LicenseFilesController.php +++ b/app/Http/Controllers/Licenses/LicenseFilesController.php @@ -143,11 +143,10 @@ class LicenseFilesController extends Controller // We have to override the URL stuff here, since local defaults in Laravel's Flysystem // won't work, as they're not accessible via the web if (config('filesystems.default') == 'local') { - \Log::debug('The private filesystem is local'); - return Response::make(Storage::get($file)); - + return Storage::download($file); } else { if ($download != 'true') { + \Log::debug('display the file'); if ($contents = file_get_contents(Storage::url($file))) { return Response::make(Storage::url($file)->header('Content-Type', mime_content_type($file))); }