lundi 16 juillet 2018

ajax request to Laravel to download file from storage return 419 code

I tried to download video use ajax and Laravel,but it return 419 code,

my Laravel code :

public function download(Request $request){
     $headers = array('Content-Type'=> 'video/mp4');
    return Storage::disk('public')->download('vfx/' . explode('/',$request->name)[3],explode('/',$request->name)[3],$headers);
}

route file :

Route::post('/download','VfxController@download');

axios ajax code:

axios.post('/download',{name:name}).then(res=>{
              console.log(res);
          }) 

Error show is: enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire