mscdex / busboy

A streaming parser for HTML form data for node.js
MIT License
2.86k stars 213 forks source link

Question: Is there a way to premature end parsing #366

Open brupxxxlgroup opened 1 month ago

brupxxxlgroup commented 1 month ago

After I have received the first file I would like to stop busboy and not process any other field or file. Is there a manual way how to do it? I don't want to set any limits btw.

mscdex commented 1 month ago

Just stop writing to the busboy stream.

brupxxxlgroup commented 1 month ago

And how you do that when the HTTP request ist the incoming source?

mscdex commented 1 month ago

I'm not sure what you mean. The source of your data doesn't matter, all you need to do is stop calling .write() on your busboy object either explicitly or implicitly.