feat(Body): Added support for
BodyMixin.formData() and constructing bodies with FormData
The code is from an older version of formidable that i ported to https://github.com/github/fetch a while back (to be more browser friendlier (without the need of having
Here is theirs new and updated code: https://github.com/node-formidable/formidable/blob/master/src/parsers/Multipart.js
Formidable have been tested with a variety of different multipart uploads and it seems pretty speedy at parsing the payload.
This is the official spec: https://andreubotella.com/multipart-form-data
Sure, As long as the body can be splittet up in chunks (anywhere) and parse different amount of bytes (even if it's splited in the middle of a boundary) and be streamable, then i'm fine with it.
It would also be nice if we could write very large files to the disk instead of keeping it in the memory also. and then use our blobs
I think this would be a grate fit for the stream-consumers it's mostly a straight out copy from undici BodyMixin that made it into node.js core. it already uses fetch-blob and is also written in ESM + that it's new so not so many breaking changes for some ppl
It dose not have formData doe since FormData isn't implemented in NodeJs but it could be one day? there is issues about bringing in FormData into node
Personally i would like to remove the
I think that we are already working in a different way in the specific return statements that I talked about, because their
Porting over the tests would be great, also adding some test case that we run both against our parser and the browser equivalent...
For Multer I would probably need something a bit more low level, since we are doing field and size validation on the fly, and also stream the files to temporary files on disk
Depends on how the API would look of course!
I was kind of thinking to make a low-level multipart parser as part of my
fyi, I already went ahead and removed it... (put a warning sign on it)