0

want to add a user to MongoDB with a profile picture as base64, username, and password but when I send the request with username and password it works because I don't require a profile picture but when I send it with the picture the problem below appears

When I try to post a request with the username & password only it worked and gets saved in MongoDB but when I add an image using Filebase64 this error appears in the console when I send

enter image description here I try to add bodyParser.urlencoded and add CORS but nothing help

enter image description here

this is Sign Up hook: I also try to add cors: 'no-cors' to the request but change nothing

enter image description here

in terminal I get PayloadTooLargeError: request entity too large only when send the image without it every thing work perfectly

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197

0 Answers0