Node Busboy abort upload

前端 未结 5 778
情书的邮戳
情书的邮戳 2021-01-04 10:37

I\'m using busboy, writing my uploaded file to a buffer and performing some validation on it (width, height and filesize). I can\'t for the life of me figure out how to abo

5条回答
  •  借酒劲吻你
    2021-01-04 10:58

    I was able to access the underlying Dicer parser which has an ignore method which essentially stops uploading the file.

    Here's how I did it: busboy._parser.parser._ignore()

    It does seem very hackish, but it works and does exactly what I wanted.

提交回复
热议问题