I use the code as below:
res.body.pipeTo(fileStream, {preventClose: true}).then(() => {code A}
when i click the browser's built-in cancel download, res still continues to be written to fileStream and execute {code A}
I expect to stop writing and subsequent operations after click cancel download. Since cancel download comes with the browser, I am unable to obtain its trigger events. Is there a good method?
I use the code as below: res.body.pipeTo(fileStream, {preventClose: true}).then(() => {code A}
when i click the browser's built-in cancel download, res still continues to be written to fileStream and execute {code A}
I expect to stop writing and subsequent operations after click cancel download. Since cancel download comes with the browser, I am unable to obtain its trigger events. Is there a good method?