const uploadFile = async () => { ImagePicker.openPicker({ width: 300, height: 300, cropping: true, mediaType: "photo", forceJpg: true, }).then((option) => { console.log(option); setImage(option.path); const data = new FormData(); data.append("file", { name: option?.filename, type: option?.mime, uri: option?.path, }); axios.post("Api_URL /provider/UploadFile", { file: data }, { headers: { Authorization: authToken,"Content-Type": "multipart/form-data", Accept: "application/json", }, } ); });};
I'm new in this field so I don't have too much knowledge about it hope for the best Thank you