Node picture upload module busboy

Image upload module busboy
how to limit the size of picture uploads,
let busboy = new Busboy ({headers: req.headers, limits: {fileSize: 1000000}})

I limited 1m in the constructor and found that large images will still be uploaded, and the result is that only uploaded images are displayed locally

I hope that when the size of the image exceeds the limit, I can throw an exception later. What should I do

Mar.13,2021
Menu