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

httpUploadProgress callback not being called #1805

Closed
iamtekeste opened this issue Nov 17, 2017 · 2 comments
Closed

httpUploadProgress callback not being called #1805

iamtekeste opened this issue Nov 17, 2017 · 2 comments
Labels
third-party This issue is related to third-party libraries or applications.

Comments

@iamtekeste
Copy link

I don't believe this is an issue with this package but I could use some help. I am trying to get back progress report of my file upload to AWS S3 from a react native app. As you can see I am listening for the httpUploadProgress event and trying to print the progress. But this callback function is not being called. What am I missing here?

const imageArrayBuffer = decode(image.data);
    const s3 = new AWS.S3();
    const params = {
        Bucket: BUCKET_NAME,
        Key: photoKey,
        Body: imageArrayBuffer,
        ContentType: image.type
    };

    s3
        .upload(params)
        .on('httpUploadProgress', function(evt) {
            console.log(
                'Uploaded :: ' + parseInt(evt.loaded * 100 / evt.total) + '%'
            );
        })
        .send(function(err, data) {
            console.log(data);
        });
@chrisradek
Copy link
Contributor

@iamtekeste
Are you using the most recent version of React Native?

The SDK uses XMLHttpRequest to make requests, and attaches a progress listener to the xhr.upload object:

xhr.upload.addEventListener('progress', function (evt) {
emitter.emit('sendProgress', evt);
});

Reading through this issue on React Native's repo, it sounds like progress events may not be implemented. It's possible they've added support on a newer version of React Native, but the fact that your callback isn't being triggered suggests they don't support this event yet. I'd suggest posting another issue on their repo asking if they can support this progress events.

@srchase srchase added third-party This issue is related to third-party libraries or applications. and removed third-party labels Jan 4, 2019
@lock
Copy link

lock bot commented Sep 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
third-party This issue is related to third-party libraries or applications.
Projects
None yet
Development

No branches or pull requests

3 participants