How does koa2+koa-bodyparser parse data in request payload form?

upload Picture Button in the form form, upload pictures are uploaded asynchronously using the upload component in layui. The backend can"t get the data, and ctx.request.body,ctx.params can"t get it either

.

clipboard.png

Aug.01,2021

Hello, landlord! You can try these two schemes, both of which can be solved at present.

  1. uses busboy to convert body body. Document Portal
  2. use middleware koa2-formidable , document Portal
    Code example:

        const formidable = require('koa2-formidable'); 
        app.use(formidable());
        const bodyparser = require('koa-bodyparser'); 
        app.use(bodyparser());

if it is helpful, please adopt ~

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e44718-5903b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e44718-5903b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?