Laravel storing only one file from multiple file upload file using AngularJS

前端 未结 1 893
醉梦人生
醉梦人生 2021-01-25 14:15

Good morning or good evening (it depends whenever you read this topic).

I wrote this code using angular and laravel to upload multiple files, but what i get from the req

相关标签:
1条回答
  • Laravel has store function use this

    foreach ($request->file as $file) {
      $filename = $file->store('folder');
    }
    

    Here folder is storage/app/folder

    You need to change in FormData like this, you have to add file[] array in FormData

    for (let i = 0; i < obj.file.length; i++) {
         let f = obj.file[i];
         fd.append('file[]', f);
     }
    
    0 讨论(0)
提交回复
热议问题