react-native-fileupload
react-native-fileupload copied to clipboard
[Android] Problem sending multiple images to my server. The server only receive the last image. It works perfectly on iOS
I send three images to my server with this code:
var obj = {
uploadUrl: Globals.BASE_URL + Globals.API_PATH + q,
method: 'POST', // default 'POST',support 'POST' and 'PUT'
headers: {
'Accept': 'application/json',
'Authorization': 'application/galickho',
},
fields: {
email:"[email protected]",
},
files: this.state.images
};
console.log(obj.files); // This is correct: 3
FileUpload.upload(obj, function(err, result) {
console.log('upload:', err, result);
if(err != null){
reject(ErrorManager.getError("http_error"));
}else{
resolve(result);
}
})
And my server returns the contents of the $_FILES variable. If I sent images from an iOS device, my server returns three images. But if I have sent the images from an Android device, only it returns the last image...
Simple PHP Code:
echo json_encode($_FILES);
Device: ACER A3-A20FHD Android OS: 4.4.2 RN ver. 0.31 RN Cli ver. 0.2.0 Plugin ver. 1.2.0
i have the same issue, when uploading files from android