react-native-fileupload icon indicating copy to clipboard operation
react-native-fileupload copied to clipboard

[Android] Error happened: Precondition Failed

Open haikov opened this issue 10 years ago • 3 comments

Hi!

I'm trying to upload an image on android with this code:

var obj = {
    uploadUrl: config.API_URL + 'images',
    method: 'POST',
    headers: {
        ...config.HEADERS,
        'Authorization': 'Bearer ' + this.userToken
    },
    fields: {
        'one': 'two'
    },
    files: [
        {
            name: 'file',
            filename: 'avatar.jpg',
            filepath: this.avatarSource.uri
        }
    ]
};
FileUpload.upload(obj, (function (err, result) {
    //err === 'Error happened: Precondition Failed'
}).bind(this));

And I'm receiving this error. Do you have any ideas why does it happen?

Thanks!

haikov avatar Jan 13 '16 08:01 haikov

hey @PhilippKrone , the same error occurred on Android (IOS works fine). Could you please help with issue?

micrum avatar Feb 17 '16 12:02 micrum

+1

BigPun86 avatar Mar 29 '16 21:03 BigPun86

same

Clcll avatar Aug 25 '17 16:08 Clcll