Laravel view file but not download






















However when I try and use a button from the view and call the controller function I get this error:. My inspection does not provide me with any other information however. Any idea what is going on? The download method may be used to generate a response that forces the user's browser to download the file at the given path.

If you want to download another just change with any n integer number. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Laravel - File Downloads Ask Question. Asked 5 years, 7 months ago. Active 2 years, 7 months ago.

Viewed 7k times. Now here is the code that resulted in this error: show. Improve this question. NSaid NSaid 1 1 gold badge 15 15 silver badges 29 29 bronze badges. Do the file exists? Please check here: laracasts. Add a comment. Active Oldest Votes.

First of all, check your file is uploaded successfully. And then specific url added in a tag download parameter. Like this. Improve this answer. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.

The Overflow Blog. Who owns this outage? Building intelligent escalation chains for modern SRE. First of all, you need to add the following routes on web. So navigate to routes folder and open web.

Then update the following methods as follow:. The above code will download files from public storage by giving the file name and return a response with correct content type. If you want to display files on blade views, so you can update the following methods into your controller file:. The above code gets the image files from the public storage folder and extract the name of these files and you pass them to your view. And create one blade view file named show.

Then update the following code into it:.



0コメント

  • 1000 / 1000