Answer the question
In order to leave comments, you need to log in
How in Laravel to provide a downloadable file (store) to the FastExcel library?
The following task appeared - to load xlsx-files into laravel and get data from them.
To open xlsx files I use the FastExcel library . It has a method - import, which needs to specify the path to the file.
I made a file download page and using the store method, I save it to the storage. The file is eventually saved to this directory - LARAVEL\storage\app.
By default, when accessing files in laravel, the LARAVEL\public\ directory is accessed.
As a result, to specify the path to the file, I specify the path like this: ..\storage\app\file.xlsx.
It seems to me that this is not correct, tell me how to do it better?
LARAVEL also has the Storage::get('file.xlsx') method, but as I understand it, it returns binary data, and the import method of the FastExcel library needs exactly the path to the file.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question