Fixed #8566 - PDF files displaying as ascii instead of downloading
This commit is contained in:
parent
a6d0209e93
commit
5ae65d5329
1 changed files with 2 additions and 3 deletions
|
@ -143,11 +143,10 @@ class LicenseFilesController extends Controller
|
||||||
// We have to override the URL stuff here, since local defaults in Laravel's Flysystem
|
// 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
|
// won't work, as they're not accessible via the web
|
||||||
if (config('filesystems.default') == 'local') {
|
if (config('filesystems.default') == 'local') {
|
||||||
\Log::debug('The private filesystem is local');
|
return Storage::download($file);
|
||||||
return Response::make(Storage::get($file));
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ($download != 'true') {
|
if ($download != 'true') {
|
||||||
|
\Log::debug('display the file');
|
||||||
if ($contents = file_get_contents(Storage::url($file))) {
|
if ($contents = file_get_contents(Storage::url($file))) {
|
||||||
return Response::make(Storage::url($file)->header('Content-Type', mime_content_type($file)));
|
return Response::make(Storage::url($file)->header('Content-Type', mime_content_type($file)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue