Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

282
Views
Upload Video To S3 With React Native

I am trying to upload video that was just created to S3 from React Native and am having some difficulties combining react-native-aws3 and react-native-fetch-blob.

There are several answers about uploading images, which works fine when I tweak the code a bit. I am confused both about how to properly pass the blob without a file path (data.uri or data.path will point to the original file which won't be uploaded properly) and about whether the options are correct.

const options = {
    keyPrefix: 'video/',
    bucket: 'XXXX',
    region: 'XXXXX',
    accessKey: 'XXXXX',
    secretKey: 'XXXX',
    successActionStatus: 201
};

uploadImage(data.path) //I call this once the video is done recording.

const uploadImage = (uri, mime = 'application/octet-stream') => {
    return new Promise((resolve, reject) => {
        const uploadUri = Platform.OS === 'ios' ? uri.replace('file://', '') : uri
        const sessionId = new Date().getTime();
        let uploadBlob = null;
        fs.readFile(uploadUri, 'base64')
            .then((blob) => {
                uploadBlob = blob;
                let file = {
                    uri: ???, //a bit confused here.
                    name: "video",
                    type: mime
                }
                RNS3.put(file, options)
                    .then(response => {
                        if(response.status !== 201) {
                            console.log(response.body);
                        }
                        console.log(response);
                    })
                    .catch(err => console.error(err));
            })
    })
}

Several other answers mentioned using FormData.I don't see how I would add that using these libraries.

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!