Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Problem sending multiple images to my server. The server only receive the last image. It works perfectly on iOS #30

Open
marseca opened this issue Aug 17, 2016 · 1 comment

Comments

@marseca
Copy link

marseca commented Aug 17, 2016

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

@xcrafter
Copy link

i have the same issue, when uploading files from android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants