Skip to content

Commit

Permalink
display 404 when file not found
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilReinking committed Jul 19, 2024
1 parent be1c28c commit f6981d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Http/Controllers/FormUploadsDownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ public function __invoke(Request $request, $upload)
{
$upload = FormSessionUpload::whereUuid($upload)->firstOrFail();

if (!Storage::fileExists($upload->path)) {
abort(404);
}

return Storage::download($upload->path, $upload->name);
}
}

0 comments on commit f6981d9

Please sign in to comment.