async uploadFile(data: FormData) {
try {
const respones = await CapacitorHttp.request({
method: 'POST',
url: this.apilUrl,
headers: {"Content-Type": "multipart/form-data"},
data: data,
})
;
console.log('duggu', JSON.stringify(respones.data))
return respones;
} catch (error) {
throw error;
}
}
async startUpload(file: LocalFile) {
const response = await fetch(file.data);
const blob = await response.blob();
const formData = new FormData();
formData.append('file', blob, file.name);
const result = await this.cameraService.uploadFile(formData)
console.log('result',result)
}
but getting this error but when i tried in browser working fine getting output also but when same file in android eumlator or device trying getting below error
{“detail”:[{“type”:“missing”,“loc”:[“body”,“file”],“msg”:“Field required”,“input”:null}]}
{“detail”:“Missing boundary in multipart.”}