mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Return a file not found error if it doesn’t appear on disk
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
8b6e8898c1
commit
e1069ac234
|
@ -128,9 +128,11 @@ class ImportController extends Controller
|
|||
$import->file_path = $file_name;
|
||||
$import->filesize = null;
|
||||
|
||||
if (file_exists($path.'/'.$file_name)) {
|
||||
$import->filesize = filesize($path.'/'.$file_name);
|
||||
if (!file_exists($path.'/'.$file_name)) {
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.file_not_found')), 500);
|
||||
}
|
||||
|
||||
$import->filesize = filesize($path.'/'.$file_name);
|
||||
|
||||
$import->save();
|
||||
$results[] = $import;
|
||||
|
|
Loading…
Reference in a new issue