var formidable = require("formidable");

export async function parseFormParam(req, res, next) {
        var form = new formidable.IncomingForm();
        form.parse(req, (err, fields, files)=>{
            if (err) {
               next(err)
            }
            else {
                req.fields = fields;
                req.files = files;
                next();
            }
        })
    }