Day 45 of #100DaysOfCode — File Upload with Multer and Cloudinary
Every app we use daily: Instagram, Twitter, Google Drive, WhatsApp, has one thing in common: they all let you upload files. Profile pictures, documents, videos, etc. While it may seem like a simple...

Source: DEV Community
Every app we use daily: Instagram, Twitter, Google Drive, WhatsApp, has one thing in common: they all let you upload files. Profile pictures, documents, videos, etc. While it may seem like a simple task on the frontend, handling file uploads on the backend involves understanding how data is transmitted, processed, validated, and stored efficiently. File uploads are one of those things that feel complicated until you understand the flow. On day 45, the goal was to understand how the backend receives the file uploaded by the user on the frontend and processes it using Multer before letting Cloudinary save it in cloud storage and return a URL we can store in the database. TL;DR Files are sent as multipart/form-data, not JSON Multer processes the file on the backend Cloudinary stores it in the cloud and gives you a URL You save that URL in your database — not the file itself Table of Contents Understanding File Upload Basics What is Multer? Multer Storage Types Basic Multer Setup File Vali