如何将此方法转换为多部分形式,以便我可以将图像和文本一起上传。有人能告诉我需要做些什么改变。
这是我的代码 -
save(event: any, type, image_type) {
const fileList: FileList = event.target.files;
if (fileList.length > 0) {
const file: File = fileList[0]
this.files = file;
this._data.data.is_image_send = true;
}
this._data.data.files = this.files;
console.log(this._data.data)
this.productdetails = this._data.data;
const reader = new FileReader();
reader.onload = (event: any) => {
this.url2 = event.target.result;
this.upload = true;
}
reader.readAsDataURL(event.target.files[0]);
}