this.camera.getPicture(options).then((imageData) => {
this.path = 'data:image/jpeg;base64,' + imageData;
},(err) => {
});
uploadImage() {
const apiPath = this.httpService.uploadUrl;
let formData = new FormData();
formData.append('imgFile', this.path);
let options = {};
this.http.post<HttpResponse<any>>(apiPath, formData, options).subscribe(this.uploadSuccess, this.errorFn);
};
按这种方法传到后端接收到的file为空这是为什么?是上传的图片路径有问题吗?
解决了没 ?