Express js form data

后端 未结 4 2016
难免孤独
难免孤独 2020-12-02 12:53

Can someone please tell me the recommended (up to date) way to get POSTed form data in express.

So many tutorials/ posts etc talk about bodyParser but this is no lon

4条回答
  •  攒了一身酷
    2020-12-02 13:25

    From the README of body-parser:

    This does not handle multipart bodies, due to their complex and typically large nature.

    The above is going to work with x-www-form-urlencoded and json but it will NOT work with any multipart. form-data is also multipart with the header multipart/form-data.

    In case of form-data, your best solution would be to use express-formidable.

提交回复
热议问题