Menu

Post image 1
Post image 2
1 / 2
0

Handling File Uploads in Express with Multer

DEV Community·Shivam Yadav·24 days ago
#lplsZ24z
#first#now#example#part#fullscreen#enter
Reading 0:00
15s threshold

yooo its me the writter of this blog today blog is all about multer yes that module which is kinda having 3 or 4 million download a week yes it has so let see what i am going to cover in this blog 1) how file transfer from frontend to backend 2) what is multer 3) how to use multer 4) kinda eveyrthing about multer and how to use it first let biginner 1) how file travels from frontend to backend Normal HTTP requests usually send text like this { "name" : "shivam" } Enter fullscreen mode Exit fullscreen mode which is done by express by adding things like app . use ( express . json ()); Enter fullscreen mode Exit fullscreen mode and app . use ( express . urlencoded ()); Enter fullscreen mode Exit fullscreen mode for text-based data. This is easy. But files are NOT text. A PNG file is raw binary bytes: 89 50 4E 47 ... Enter fullscreen mode Exit fullscreen mode So browsers needed a special way to send everything in proper way: text files metadata all together in ONE request.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More