Express.js · Method
res.attachment
res.attachment() marks an HTTP response as a file attachment. An optional filename sets the download name and the Content-Type from its extension.
Last updated
Syntax
res.attachment([filename])In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
res.type()res.download()res.set()