title: Multiple image upload in ionic 5 angular (Capacitor Camera) and nodejs multer
body: <p><strong>I'm trying to upload multiple images in ionic angular app not able to send the correct payload to the API.sending data from postman working well. Back-end using nodejs multer package for handling the image upload.</strong></p>
  <p>How to send correct payload from UI to backend. For web we can use form data for image upload but mobile not able to find the solution</p>
  <p><a href="https://i.stack.imgur.com/DjQz6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DjQz6.png" alt="postman payload" /></a></p>
  <h2>In Html File</h2>
  <pre><code>&lt;ion-button fill=&quot;outline&quot; expand=&quot;block&quot; color=&quot;secondary&quot; (click)=&quot;selectImageSource()&quot;&gt;
       &lt;ion-icon slot=&quot;start&quot; name=&quot;camera&quot;&gt;&lt;/ion-icon&gt;
        Upload
   &lt;/ion-button&gt;
  </code></pre>
  <h2>TS File</h2>
  <pre><code>async selectImageSource() {
      const buttons = [
        {
          text: 'Choose from gallary',
          icon: 'image',
          handler: () =&gt; {
            this.addImage(CameraSource.Photos);
          }
        }
      ];
  
      const actionSheet = await this.actionSheetController.create({
        header: 'Select image source',
        buttons
      });
      await actionSheet.present();
    }
  
  async addImage(source: CameraSource) {
      const image = await Camera.getPhoto({
        quality: 100,
        resultType: CameraResultType.Base64,
        source,
        allowEditing: false
      });
  
      const blobData = this.b64toBlob(image.base64String, `image/${image.format}`);
      const uploadParams = {
        userId: 'Abcd1234',
        uploadType: 'profile-pics'
      };
  
      this.apiService.uploadPhotos(blobData, uploadParams)
        .subscribe((img: any) =&gt; {
          console.log('Image: ', img);
        }, (err) =&gt; console.log('Eror: ', err));
    }
  
  
      b64toBlob(b64Data, contentType= '', sliceSize= 512) {
      const byteCharacters = atob(b64Data);
      const byteArrays = [];
  
      for (let offset = 0; offset &lt; byteCharacters.length; offset += sliceSize) {
        const slice = byteCharacters.slice(offset, offset + sliceSize);
  
        const byteNumbers = new Array(slice.length);
        for (let i = 0; i &lt; slice.length; i++) {
          byteNumbers[i] = slice.charCodeAt(i);
        }
  
        const byteArray = new Uint8Array(byteNumbers);
        byteArrays.push(byteArray);
      }
  
      const blob = new Blob(byteArrays, {type: contentType});
      return blob;
    }
  </code></pre>