1
votes

I'm using AWS JavaScript SDK in a Cordova application on Android and have set the configuration as below

AWS.config = new AWS.Config({
    region: Constants.region,
    httpOptions: {
        timeout: 1200000    //20 mins
    }
});

I'm able to upload images and text files of > 2MB size without issues. But the code always fails to upload video files of any size. Below are the error logs I'm getting

PUT https://s3.ap-south-1.amazonaws.com/my-s3-bucket/files/VID-20170127-WA0017.mp4 net::ERR_CONNECTION_RESET

PUT https://s3.ap-south-1.amazonaws.com/my-s3-bucket/files/VID-20170127-WA0017.mp4 net::ERR_CONNECTION_RESET

PUT https://s3.ap-south-1.amazonaws.com/my-s3-bucket/files/VID-20170127-WA0017.mp4 net::ERR_CONNECTION_RESET

PUT https://s3.ap-south-1.amazonaws.com/my-s3-bucket/files/VID-20170127-WA0017.mp4 net::ERR_CONNECTION_RESET

It seems that the connection is reset after about 45-50 seconds inspite of the 20 min. timeout configuration

1
Did you find a solution to your problem? - Marklar

1 Answers

0
votes

Even though I am not sure about the reason why it happens, I have noticed that Android upload with https Url for large file fails with AWS S3. This has something to do with the https certificate of AWS because I haven't faced the issue with DigitialOcean Spaces.

So the solution here is trying uploading to non-https end-point.