Skip to content

Commit

Permalink
fix doc not found
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarzin committed Sep 25, 2024
1 parent edc03e7 commit 7954fbd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Http/Controllers/DocumentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ public function get(int $id)
'403 Forbidden'
);

// get path
$path = storage_path('docs/' . $id);

// check file exists
abort_if(!file_exists($path), Response::HTTP_NOT_FOUND, '404 Not Found');

// get file content
$file_contents = file_get_contents($path);

return response($file_contents)
Expand Down

0 comments on commit 7954fbd

Please sign in to comment.