如何将 fromdata 中的 base64 从 ionic 或 angular 发送到 nodejs 服务器?

How to send base64 in fromdata to nodejs server from ionic or angular?

Backend save file on file system pickImage(sourceType) { 常量选项:CameraOptions = { 质量:100, 来源类型:来源类型, 目的地类型:this.camera.DestinationType.DATA_URL, 编码类型:this.camera.EncodingType.JPEG, 媒体类型:this.camera.MediaType.PICTURE, 正确方向:真, }; // this.camera.getPicture(选项).then((图像数据) => {

    this.camera.getPicture(options).then(
      (imageData) => {


        const formData = new FormData();

        formData.append('file', imageData);
        let newName = this.randomString(6) + new Date().getTime() + "." + file.type;

        alert(JSON.stringify(formData));

 this.http.post("//localhost:3000/api/v1/Admin/saveAllImages", formData)
        .pipe(
            finalize(() => {
                // loading.dismiss();
            })
        )
        .subscribe(res => {
            if (res['success']) {
                this.presentToast('File upload complete.')
            } else {
                this.presentToast('File upload failed.')
            }
        });
    };

}
let formData = new FormData();
let blob = this.DataURIToBlob(this.imageData);
formData.append('file', blob)


DataURIToBlob(dataURI: string) {
        const splitDataURI = dataURI.split(',')
        const byteString = splitDataURI[0].indexOf('base64') >= 0 ? atob(splitDataURI[1]) : decodeURI(splitDataURI[1])
        const mimeString = splitDataURI[0].split(':')[1].split(';')[0]

        const ia = new Uint8Array(byteString.length)
        for (let i = 0; i < byteString.length; i++)
            ia[i] = byteString.charCodeAt(i)

        return new Blob([ia], { type: mimeString })
      }