Rectangle 27 0

javascript Corrupt filesimages when uploaded to nodejs?


Good luck writing a parser.

In this case I'm receiving just one part, it is a favicon. What I want is parse the multipart and then save the file on the disk without using modules.

You're sending a multipart request. This means it's not just the raw contents of the single file you're uploading, but a special format that allows for multiple parts where each part is a separate form field (in your case there is only 1 part -- the file form field). You should look into using a module that can parse multipart/form-data requests for you such as busboy, multiparty, or formidable.

Note