DEV Community

Anindya Chowdhury
Anindya Chowdhury

Posted on


How do you store the pictures that users have uploaded in your website?

I did a training on Node.js in a company and the trainer there showed us how to convert an image to Base64 and store it into the database. What do you all think about that? Also how do you handle image uploaded to your website?

Top comments (1)

dmfay profile image
Dian Fay

Storing images inline in the database can raise hackles, but honestly if you know you aren't going to be dealing with a huge image collection it can't be beat for convenience.

Recently I used Amazon S3 to store images and the getSignedUrl API to generate <img> elements for an internal application.

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.