Answer the question
In order to leave comments, you need to log in
How to download a file by full path?
On the client, I get a response from the server with the full path to the file:
{file: "C:\Projects\events\Backend\storage\app/events/events_31-03-19.xlsx"}
window.location.href = res.file;
return \Response::json(["file" => storage_path('app/'.$path.$filename)]);
Answer the question
In order to leave comments, you need to log in
Firstly, response should not be in json. symfony response has a binary method that will return a file upload.
Second, check out the laravel storage documentation. Very handy bike protection mechanism
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question