I'm trying to have a controller action in my app, upon a button being clicked by a user, attach the requested file and redirect all in one controller action.
I'm having trouble doing so though, because if I place a res.redirect
after my res.attachment() ; res.send()
, the file won't send, and if I leave out the redirect, the file sends but no redirect occurs. How should I handle this?