Tuesday 11 April 2017

Converting files with Lambda

I have an HTML form I use to upload images. I am able to upload the images to S3 with node:

var upload = multer({
   storage: multerS3({
       s3: s3,
       bucket: 'mybuket',
       key: function (req, file, cb) {

 var extension = file.originalname.substring(file.originalname.lastIndexOf('.')+1).toLowerCase();

            cb(null, file.originalname);


            if(extension=="gif"){
                console.log("Gif uploaded");
            }
       }
   })
});

app.post('/upload', upload.single('file'), function(req, res){
    res.send("Success");    
});

I want to convert the .gif files to .mp4. How and where do i need to invoke the Lambda function. Do I need to upload the image to S3 first and than convert it or can I convert the .gif and than upload to the S3 bucket?

Please help. Any suggestions welcome.



via Somename

No comments:

Post a Comment