Replies: 1 comment 1 reply
-
Try Maybe better to close this issue and instead start a discussion here: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
According to the Laravel's file storage documentation ( https://laravel.com/docs/8.x/filesystem ) I am performing a
store()
operation to save an uploaded file in my local disk, but then, when I usedownload()
to have it back, I receive a «file not found error».Perhaps I am mistaken nd someone can tell me what I am doing wrong, but for the case, I preferred to rise the issue.
Thanks and best regard.
Steps To Reproduce:
I am trying to upload a pdf to my local storage doing:
$validated['pdf'] = $request->pdf->store('');
and then$model->update($validated);
This stores a random-name with «pdf» extension file in the database (for example jf9T0Oo9OK7EshXjsxjNghKHczShLWHa4mwYCMg7.pdf ).Then I try to donwload the file doing
return response()->download($model->pdf);
but I receive an error:Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException
The file "71NgZS0q3TMzbe8eSHkH36kfPIFxLrnbqNnmMyNh.pdf" does not exist
In order to understand what is happening, I have tried to do it using storage_path() and I could see that in the path, the directory «app» under «storage» is missing, so I could make the donwload with the following turnaround:
return response()->download(storage_path('app/' . $model->pdf));
(Am am working in a local installation of XAMPP for OS X 7.3.20)
Beta Was this translation helpful? Give feedback.
All reactions