DEV Community

Discussion on: Open Question: How can I upload files to S3 from Node.js, while having a progress bar and the ability to resize the image?

Collapse
 
panphora profile image
David Miranda

Hi Daniel! I really appreciate this response!

I've done some searching based on your serverless suggestion and found some amazing options.

One option is a Serverless Image Handler directly from AWS. I think it would let me upload an image directly to an S3 bucket (thereby getting a progress bar) and then serve these images with Cloudfront.

However, the huge bonus is that I think it detects whenever an image is uploaded and uses the API Gateway service (through a Lambda function) to modify the image according to one of these transformations.

The second option I found through a dev.to post, which walks you through creating a serverless web app service that can upload images to S3 and then modify them. I'm not positive if I'd be able to get the progress bar with this solution, but I think I probably could.

However, after all this research, I decided to go with Oreoluwa's solution, which he posted in a comment below. I decided that I'd rather not build/maintain a serverless app in addition to my own app -- and with my usage, Cloudinary will be free for me for a while. I could see switching over to one of the options above in the future when I get a bigger tech team, but right now it's just me and building/marketing/selling one service is already too much. I don't want to take on a whole new stack (i.e. serverless) that I don't have a lot of familiarity with yet.

Anyways -- thank you for your help! It's much appreciated!!