Added uploaded files API controllers and presenters
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
@@ -48,6 +48,7 @@ class StorageHelper
|
||||
'avif',
|
||||
'webp',
|
||||
'png',
|
||||
'gif',
|
||||
];
|
||||
|
||||
|
||||
@@ -59,6 +60,18 @@ class StorageHelper
|
||||
|
||||
}
|
||||
|
||||
public static function getFiletype($file_with_path) {
|
||||
|
||||
// The file exists and is allowed to be displayed inline
|
||||
if (Storage::exists($file_with_path)) {
|
||||
return pathinfo($file_with_path, PATHINFO_EXTENSION);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Decide whether to show the file inline or download it.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user