我试图使用formdata将图像发布到nestJS支持的后端,但遇到了当formdata到达后端时formdata未定义的问题。我试着用postman上传了一张图片,结果达到了预期的效果。
以下是我的前端代码:
let blob = this.getBlob(results[i], ".png");
const file = new File([blob],name, {type:"image/png"});
let postData = new FormData();
postData.append('file', file);
this