vendredi 27 décembre 2019

uploading multple image in laravel and vue this code not work perfectly

  1. I tried so many time but it's not working correctly. when I upload 3 images but its only upload 2 images but when I upload 4 Image its only upload 2 images. How many images above 1 I upload it's only work for two images

    Laravel Code

    [I think laravel code does not work][1] $multipleImages=$request['sub_image']; for($i=1; $iresize(200,200); $public_path=public_path()."/sub-Image/"; $image->save($public_path.$name); }

    Vue JS Code :[its working correctly][2]  SubimageUpload(e) {
      for (let i= e.target.files.length-1; i>=0; i--) {
      var fileReader = new FileReader();
       fileReader.readAsDataURL(e.target.files[i]);
        fileReader.onload = e => {
        this.form.sub_image[i] = e.target.result;
      };
    
      }
      console.log(this.form);
      },
    

    [1]: https://i.stack.imgur.com/i8wGW.png [2]: https://i.stack.imgur.com/QCHHj.png



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire