I have this datacame from react-native-image-picker
data: "/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2Qtan" => 90kbfileName: "77677.jpg"fileSize: 67542height: 600isVertical: trueoriginalRotation: 0path: "/storage/emulated/0/Download/77677.jpg"type: "image/jpeg"uri: "content://media/external/images/media/18584"width: 399__proto__: Object
and am try to set this data in object type #FromData to upload #img
var binaryDataInBase64 = new FormData(); binaryDataInBase64.append('file', { // data: response.data, uri: 'file://'+ response.uri, name: 'MMM.jpg', type: response.type }) console.log('=======================>', binaryDataInBase64) axios.post('https://danskeclouddemo.com/api/file', { file: binaryDataInBase64 }, { headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'multipart/form-data' } } ).then(res => { console.log(res) }).catch(error => { console.log(error) })
and this is BackEnd Postman Working good Postman collection
//======================//======================Edit
Some people talk about the problem from react native version after 0.61.5in this link issues