How to make a file downloadable in Laravel

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys welcome to this story on Laura for this story I'm would you like to make a fart on the dip in the river so um these developers are going to be working with a black audience so up were your code editor so industries I'm going to use features to do so let's start by creating a download button down in your blog project so whoop your resources for the on that views but we welcome table little place before then scroll down to this section and I have a best create an uncle table the enter prompt is download then let's tell it to make you look like a button so this is separate from other content of the page then asking test decoration so aggressive it so let's work we are now this way we have none so let me heart break tidy that's a pretty fun day disappear from this so this what we have now we have our double button yet so let's grant read or download function so what's your rock for the the open web drop pitch before yeah this is a road file so let's go it's rad for download so let's topic retain a variable to get Farah one to download so what's going on now is the public park now is about your public figure the larvae project so this public today is where we are going to put to the end if I were going to be here to be downloading so this my own fire ample group dot PDF so if what's your if and if I want to download you can put a file properly for that I'm using this function speech before show you'll be able to locate this path and then we will download it accurate on a buffer day if want some pure far more grains but under the inside but in this tutorial I just go to mind I click on that then that's where just puts in that it so it puts in order for that lasted for - go for some cows then it's going to be fouled then / you know the name of the farm but in this case I just drop it in that territory so just slash impossible dr. Dale so this we get the parts so our download so a downward so which is improved this tutorial so unless ground that's great ed us you click it download the credit unfortunate piece before you water stone what is going on in this place so re cut another consumer gets over there now content type the content type is going to be application slash PDF in this case under all the PDF in this case as you see PDF this show me a man tag so it's gonna be done before it on the mp3 can be any man type you want by this case mr. speedy Arizona PDF so let's go on a return route on response download so using this letter for function download so this Delta function is weighted our method is going to take three parameters the first one is going to be the file you'll be downloading this is going to be what we've got err what we get the first favorable critter with is the file which is the farm so under the next one is the name of the file after the download it went to that on and I will defy the name that's because so in this case our colored inputs grow the PDF so this is an image because my daddy taught parent is going to be this error this would be this I didn't just get Somali everyone yeah let me just make it flora add us others so this is true parameter to be an to be taken so with this now we should be able to download our farm so let's test it out save it let's go to our browser refresh let's click on download you can see the download is working so let's confirm that is working open it and that's it so that's what farm and does that you make it down low how to make fat under the book in the refer so let me just go through it again we start by going over comes up with a doublet of HP then we screwed onto the sessions that got created a low-bottom the user can click on to download a file then the patch of the foresty slash download slides download then we started to make it look like a button then that's all we did then we saved we went to the road fund then creature of rot column then gets slash this the road to slow download and create an animal function then the name of there we are getting the file from public parts which are popular for larger projects so this forest for Diegan down and this ferret and Odin so we then this using this very functional get it and parts of this photo I am Dan slash the name of the fire so if you have defined our for the inside of the fog was pretty much the name just put slash the name of the florist and the name on file for this case just drop in there so just grouped up PDF now there has we create a dance for downloads of the content type working this verse with all these applications los entity there is another mime type Dan's going to be mp4 mp3 or any other lamp type you want then there we are click return response it's going to be downloaded adjustments both with the download so using the verify Daniel function which will and I'll be taking three parameter first one we're going to be the file be downloading they didn't name after them after dessert under the instance because our headers the sword and be able to download the file so this all you need to be able to download in the raffle now in this in this editor defiers given already so um the up treating let's try that at the fire going to be downloaded which we take you from my squad at abyss so if you wife once if what is so I can go to a pure protein to reversion then can be able to use their own case you're uploading then go to download Moises because damn big of video on the website and so on so you can go to the further so don't forget subscribe just and China on like these videos we like it thank you
Info
Channel: SmatHub
Views: 12,161
Rating: undefined out of 5
Keywords: download in laravel, laravel download button, laravel, laravel 5.4, laravel route, laravel download
Id: wpdUwVhj0MY
Channel Id: undefined
Length: 8min 50sec (530 seconds)
Published: Sat Jan 13 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.