Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29746

React native 0.62.0 - Network request error on Android for file upload

$
0
0

I have upgraded react-native to 0.62 and i got the problem of Network error for Android only, iOS works fine.

I use FormData object to populate data formated as

const data = new FormData(); 
// On Android i add file protocol to file path - file://... 
data.append('photos', { 
   uri: 'file:///data/.../my-image.jpeg', 
   type: 'image/jpeg',
   name: 'my-image.jpeg' 
});

and other textual data

data.append('description', 'my long description...');

Does anyone have the problem?

I have tried multiple Android SDKs 27, 28, 29, and got same problem on all :(

The things is if i do not upload images, but only textual data request works just fine :(

Any suggestion welcome :)?


Viewing all articles
Browse latest Browse all 29746

Trending Articles