1

I get this error:

Error: Malformed part header

when making multipart/form-data request in Node.js - no code files visible in the error.

I'm encountering a "Malformed part header" error when trying to upload two files one video and another thumbnail in cloudinary I am certain that the file sizes of both does not exceed 100mb for free tier. The full error message from my console is:

Error: Malformed part header
    at SBMH.sscb [as _cb] (C:\Users\samue\Desktop\Full-Code\Backend-course\node_modules\busboy\lib\types\multipart.js:398:32)
    at feed (C:\Users\samue\Desktop\Full-Code\Backend-course\node_modules\streamsearch\lib\streamsearch.js:248:10)
    at SBMH.push (C:\Users\samue\Desktop\Full-Code\Backend-course\node_modules\streamsearch\lib\streamsearch.js:204:16)
    at Multipart._write (C:\Users\samue\Desktop\Full-Code\Backend-course\node_modules\busboy\lib\types\multipart.js:567:19)
    at writeOrBuffer (node:internal/streams/writable:564:12)
    at _write (node:internal/streams/writable:493:10)
    at Writable.write (node:internal/streams/writable:502:10)
    at IncomingMessage.ondata (node:internal/streams/readable:1007:22)
    at IncomingMessage.emit (node:events:518:28)
    at Readable.read (node:internal/streams/readable:790:10)

Interestingly, the error stack trace doesn't seem to point to any of my own project files. All the paths in the stack trace lead to files within the node_modules directory, specifically related to busboy.

Here's a link to my GitHub repository -> link

-> Is it caused by Postman? Because I tried using bruno, and encountered the same error

-> Any good alternative of the code to upload to cloudinary?

4
  • Do any of the answers to Why do I get this error: Postman Error: Malformed part header? help? Commented May 3 at 18:47
  • 1
    this is really stupid but i am getting used to happening stupid things soooooooooooooooooooooooooo i was trying to upload a video file and a thumbnail video file named ->[]Pinkman_At_call ( i added the square brackets to make it look like the character it was there i don't what was that even my pc showed it as []) then i renamed the file -> Pinkman_At_call and it worked I DONT KNOW WHY !!!!!!!!!!!!!!!!!!!!!!!! Commented May 4 at 9:10
  • It could be that somewhere along the way the characters need to be from some restricted set. If you want to make your program reliable in that respect, you would need to investigate which characters are allowed and remove any that don't match. Commented May 4 at 10:16
  • how do i do that the error is in the busboy folder must be the part of the multer, and i am learning right now this is my project for learning the backend. but thanks for the reply I appreciate it! Commented May 4 at 14:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.