mirror of
https://github.com/expressjs/expressjs.com.git
synced 2026-02-21 19:41:33 +00:00
17 lines
544 B
Plaintext
17 lines
544 B
Plaintext
section
|
|
h3(id='res.attachment') res.attachment([filename])
|
|
|
|
p.
|
|
Sets the Content-Disposition header field to "attachment". If
|
|
a <code>filename</code> is given then the Content-Type will be
|
|
automatically set based on the extname via <code>res.type()</code>,
|
|
and the Content-Disposition's "filename=" parameter will be set.
|
|
|
|
+js.
|
|
res.attachment();
|
|
// Content-Disposition: attachment
|
|
|
|
res.attachment('path/to/logo.png');
|
|
// Content-Disposition: attachment; filename="logo.png"
|
|
// Content-Type: image/png
|