title: How to store Images in S3 bucket?
body: <p>in my express application, I have my images being saved to a folder in my repo.</p>
  
  <p>However i dont think this is correct i should store them somewhere else, i thought s3 would be a good option.</p>
  
  <p>Ive never done it before so i have no idea how it works.</p>
  
  <p>My  currrent code saves the image after scaling it:</p>
  
  <pre><code>exports.resize = async (req, res, next) =&gt; {
    // check if there is no new file to resize
    if (!req.file) {
      next(); // skip to the next middleware
      return;
    }
    const extension = req.file.mimetype.split('/')[1]
    req.body.photo = `${uuid.v4()}.${extension}`
    // now we resize
    const photo = await jimp.read(req.file.buffer)
  
  
    await photo.cover(300, 300);
    // await photo.resize(800, jimp.AUTO);
  
    await photo.write(`./public/uploads/${req.body.photo}`);
    // once we have written the photo to our filesystem, keep going!
    next()
  };
  </code></pre>
  
  <p>Whats the process in order to save the images to aws s3?</p>
  
  <p>Thanks</p>