How to accept profile pictures, documents, and any file your users throw at your server. The first time I tried to handle a file upload in Express, I wrote something like this: app . post ( " /upload " , ( req , res ) => { console . log ( req . body ); // Where's my file? }); I submitted a form with an image attached, checked req.body , and got... nothing. An empty object. The file had vanished into the void. Turns out, express.json() and express.urlencoded() can't handle files. Files are sent i
Comment
Sign in to join the discussion.
Loading comments…