Skip to content
Advertisement

Laravel how download file for Auth() user in dashboard view

I have big problem to enable Auth users download stored files in laravale storage. Users has in table users field id_message which is unique name of folder where user has file to download.

What has to be made in AuthController which controll dashboard.blade to access user download file ? problem is how add from table variable id_message to file path

File is stored /app/files/{id_message}/*.zip

JavaScript

And at the end, what will be in blade

JavaScript

Can’t understand why is this problem so hard to solve it for me.

Advertisement

Answer

you can simply use an <a> tag with file url as the href of the tag.

JavaScript

or you can do it with a controller method.

route

JavaScript

controller

JavaScript

and in view

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement