Im tring to upload image to firebase using formdata.but im getting this error
"Invalid data; couldn't parse JSON object, array, or value."
This is my code
const formData = new FormData();
formData.append('Lname', 'aa');
formData.append('FName', 'aas');
formData.append('image', {
url:image,
name:'profilePic.jpg',
type: 'image/jpg'
})
const request = axios({
method: 'POST',
url:`https://test2card-e8014.firebaseio.com/profileInfo.json`,
data: formData,
headers: {
'Content-Type': 'multipart/form-data;',
},
}).then( response => {
console.log('log', response.data)
return response.data
}).catch(e=>{
console.log('err',e.response.data)
})
and im using ios simulator this my image url - file:///Users/kk/Library/Developer/CoreSimulator/Devices/3ED3277A-DE0C-478A-AFAE-FE24D67A76DB/data/Containers/Data/Application/D091EAA9-E390-49C8-AFF7-E862A6A8B93A/Documents/images/F0FDE0FB-84FE-43BB-8F0C-25D52A223703.jpg
and also can I know what is best and efficient way to get this done.
Thank you.