mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -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->file_path = $file_name;
|
||||||
$import->filesize = null;
|
$import->filesize = null;
|
||||||
|
|
||||||
if (file_exists($path.'/'.$file_name)) {
|
if (!file_exists($path.'/'.$file_name)) {
|
||||||
$import->filesize = filesize($path.'/'.$file_name);
|
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.file_not_found')), 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$import->filesize = filesize($path.'/'.$file_name);
|
||||||
|
|
||||||
$import->save();
|
$import->save();
|
||||||
$results[] = $import;
|
$results[] = $import;
|
||||||
|
|
Loading…
Reference in a new issue