Skip to content
Myr

Docs for res.attachment()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 0c5fe61 · Browse files · 3 files+26 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+26 added−0 removed

  • other:+26 added−0 removed

3 files+26 added−0 removed

modified:docs/guide.1+13 added
244 unmodified lines
245.fi246.247.IP "" 0248.249.SS "ServerResponse#attachment([filename])"250Sets the \fIContent\-Disposition\fR response header to \"attachment\", with optional \fIfilename\fR\.251.252.IP "" 4253.254.nf255256 res\.attachment(\'path/to/my/image\.png\');257.258.fi259.260.IP "" 0261.262.SS "ServerRequest#send(body|status[, headers|status[, status]])"263The \fBres\.send()\fR method is a high level response utility allowing you to pass objects to respond with json, strings for html, arbitrary _Buffer_s or numbers for status code based responses\. The following are all valid uses:264.265.IP "" 4
86 unmodified lines
modified:docs/guide.html+7 added
335 unmodified lines
336 res.contentType(filename);337 // res.headers['Content-Type'] is now "image/png"338</code></pre>339340<h3 id="ServerResponse-attachment-filename-">ServerResponse#attachment([filename])</h3>341342<p>Sets the <em>Content-Disposition</em> response header to "attachment", with optional <em>filename</em>.</p>343344<pre><code> res.attachment('path/to/my/image.png');345</code></pre>346347<h3 id="ServerRequest-send-body-status-headers-status-status-">ServerRequest#send(body|status[, headers|status[, status]])</h3>348349<p>The <code>res.send()</code> method is a high level response utility allowing you to pass350objects to respond with json, strings for html, arbitrary _Buffer_s or numbers for status
61 unmodified lines
modified:docs/guide.md+6 added
160 unmodified lines
161 var filename = 'path/to/image.png';162 res.contentType(filename);163 // res.headers['Content-Type'] is now "image/png"164165### ServerResponse#attachment([filename])166167Sets the _Content-Disposition_ response header to "attachment", with optional _filename_.168169 res.attachment('path/to/my/image.png');170171### ServerRequest#send(body|status[, headers|status[, status]])172173The `res.send()` method is a high level response utility allowing you to pass174objects to respond with json, strings for html, arbitrary _Buffer_s or numbers for status
50 unmodified lines