Here I created an empty array of promises to store each response of the upload call. Next, I am mapping images array to upload calls with a single image and promises.push is saving that response in promises array.
RNS3.put
Next, I defined my uploadImageToS3 a method like its mentioned in the example of react-native-aws3.
This method is returning the promise of URL/location of the image as an object having value src.
Now I combined all promises with Promise.all function.
Promise.all(promises).then(uploadedImgs => {
console.log('Yayy, all images are uploaded successfully', uploadedImgs)
});
Creating a new issue to enhance attention
If you are wondering how to upload multiple files to S3 bucket...
Below worked for me!!!
Original Source
Here I created an empty array of promises to store each response of the upload call. Next, I am mapping images array to upload calls with a single image and promises.push is saving that response in promises array.
RNS3.put Next, I defined my uploadImageToS3 a method like its mentioned in the example of react-native-aws3.
This method is returning the promise of URL/location of the image as an object having value src. Now I combined all promises with Promise.all function.
uploadedImgs array will look like this