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

Unable to upload video when bucket name contains dots eg. domain names

Open tomasz-konecki opened this issue 6 years ago • 0 comments

Hi,

First of all, I would like to say that I appreciate your effort to create this library. After some time of using it in my react native application, I noticed that occasional problems occurred while uploading videos to the server. It turned out to be due to the structure of the url variable in the RNS3.js file.

I changed the original structure:

var url =
  "http://" +
  options.bucket +
  "." +
  (options.awsUrl || AWS_DEFAULT_S3_HOST);

to:

var url = `https://s3.${options.region}.amazonaws.com/${options.bucket}/`;

and now it is working without any problems.

tomasz-konecki avatar Aug 30 '19 11:08 tomasz-konecki