Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUsing form.onPart() to validate file type/name and then form.parse to recrive the file #617
Comments
|
Thank you for raising this issue! We will try and get back to you as soon as possible. Please make sure you format it properly, followed our code of conduct and have given us as much context as possible. |
|
True. And not. Just realized that we don't document the usage of The easiest thing would be (and I guess should be recommended) is calling the I will look into it more later. |
|
Thanks! I'll give it a shot. I think I'm about to try to become a contributor BTW! I think I could help improve documentation for a start. |
|
I ended up going with express-fileupload (busboy wrapper) because the middleware implementation allows me to respond with a 413 response as early as possible in the request/response cycle. I believe that's before the stream is parsed at all. |
That would be great, yea. :)
True. Most probably. Busboy is great, for sure! Here we are kind of stopped because of legacy and architecture. I'm thinking to release v2 then a whole rewrite could happen. |
|
@droddy multer let you do this also, you have a nice @tunnckoCore integrate all of this in a nice v2 of formidable should be pretty formidable PS: I'm not promoting anything here, just give you some options to complete what you want. |
|
Yup These features are most wanted, even back then (2016-ish) when I wasn't core maintainer here and but was maintaining my Anyway. |
Should I be able to use form.onPart() along with form.parse() in order to
form.onPart(): test for valid file types and return validation message if that fails or continue on to...
form.parse(): parse the file if the validation in form.onPart() passes?
I can't seem to find the right way to do this.
CONTROLLER:
SERVICE/formidable parse wrapper:
Originally posted by @droddy in #387 (comment)