It is better not to use AJAX for downloading a file, just use normal URL for it.
Dec 13, 2022
3
Level 1
Download file from enpoint API
I would like to download a file directly from the api function (backend).
I currently store my file on storage public then I return response()->download($myFilePath) but it doesn't trigger the download it returns a response in my console like a binary file.
Please or to participate in this conversation.