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
 
ore profile image
Oreoluwa Ogundipe

Hi David. Hope you're enjoying the holidays.

Interesting problem you have here. So, I'd suggest using Cloudinary to handle media uploads and transformations in your application. This is mostly because I've had some experience using their service and I believe it will give you a hassle-free way of uploading images using just an upload endpoint thus, not increasing the bundle size of your application in any way. Let me highlight what advantage using Cloudinary gives you:

  • Cloudinary allows you to make media uploads using just a simple post request to an endpoint and an Upload Preset + the file you want to upload. This reference shows how to make simple uploads using just an endpoint. With this, you don't have to worry about increasing the bundle size of your application in any way.

Using an upload preset

  • Another thing to note is that with Cloudinary Upload Presets, you can tie different transformations to an upload preset. For example, if you wanted to crop every image, you no longer have to create another function to do that every time. You can just tie the transformation to the upload preset and once you make an upload, Cloudinary handles the media transformation for you.

  • With regards to the cost involved, with Cloudinary, you pay based on your usage. This article explains in detail how the transformation quotas work.

Hope this helps!

Collapse
 
panphora profile image
David Miranda

Oreoluwa! This is the perfect solution!!

I've worked with Cloudinary before, so their API is pretty familiar to me. However, I had no idea about their support for uploading directly to an endpoint (I should've known!).

Thank you for this!

After a lot of research, this is the solution I'm going to use. It's just soooo convenient and sooo easy compared to all the other solutions I've researched. And, having worked with Cloudinary in the past, I'm very impressed with the power of their API (like being able to generate zip files from multiple files on the fly -- so users can download them all at once.

Thank you very much!

I still wish there was an easy way to do this on my own, but this solution will definitely suffice for the foreseeable future.