fino a eventi e report prima del tipo di eventi
This commit is contained in:
@@ -192,11 +192,19 @@ class DocumentoController extends Controller
|
||||
$fullPath = Storage::disk('local')->path($documento->file_path);
|
||||
$mimeType = $documento->mime_type;
|
||||
|
||||
if (str_starts_with($mimeType, 'image/')) {
|
||||
$previewableMimeTypes = [
|
||||
'image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/svg+xml',
|
||||
'application/pdf',
|
||||
'text/plain', 'text/html', 'text/csv',
|
||||
];
|
||||
|
||||
if (in_array($mimeType, $previewableMimeTypes)) {
|
||||
return response()->file($fullPath, ['Content-Type' => $mimeType]);
|
||||
}
|
||||
|
||||
return response()->file($fullPath, ['Content-Type' => $mimeType]);
|
||||
return response()->view('documenti.preview-fallback', [
|
||||
'documento' => $documento,
|
||||
])->header('X-Preview-Fallback', 'true');
|
||||
}
|
||||
|
||||
public function destroy($documento)
|
||||
|
||||
Reference in New Issue
Block a user