Skip to content Skip to sidebar Skip to footer

Axios Unable To Upload File On Android But Working On Ios

I am trying to upload files to the server using Axios in React-Native. The files are getting uploaded on iOS but on Android they are not getting uploaded React-Native Axios sync c

Solution 1:

Axios is creating a lot of problems with formdata on Android. So I recommend using a different API.

You can use XMLHttpRequest

let xhr = newXMLHttpRequest();
xhr.open('POST', uploadUrl);
let formdata = newFormData();
// add json file 
formdata.append('files', { uri: filePath, name: fileName, type: 'json' });
xhr.send(formdata);

Post a Comment for "Axios Unable To Upload File On Android But Working On Ios"