Skip to content
Myr

Better docs for res.sendfile()

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 dbc5bd4 · Browse files · 3 files+9 added−5 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+9 added−5 removed

  • other:+9 added−5 removed

3 files+9 added−5 removed

modified:docs/guide.1+1 added-1 removed
609 unmodified lines
610.611.IP "" 0612.613.P614\fBNOTE\fR: this is \fInot\fR a replacement for Connect\'s \fIstaticProvider\fR middleware, nor does it perform any security checks, use with caution when using in a dynamic manner\.614This is \fInot\fR a substitution for Connect\'s \fIstaticProvider\fR middleware, it does not support HTTP caching, and does not perform any security checks\. This method is utilized by \fIres\.download()\fR to transfer static files, and allows you do to so from outside of the public directory, so suitable security checks should be applied\.615.616.SS "res\.download(file[, filename])"617Transfer the given \fIfile\fR as an attachment with optional alternative \fIfilename\fR\.618.
343 unmodified lines
modified:docs/guide.html+4 added-2 removed
624 unmodified lines
625626<pre><code>res.sendfile('path/to/my.file');627</code></pre>628629<p><strong>NOTE</strong>: this is <em>not</em> a replacement for Connect's <em>staticProvider</em> middleware,630nor does it perform any security checks, use with caution when using in a dynamic manner.</p>629<p>This is <em>not</em> a substitution for Connect's <em>staticProvider</em> middleware, it does not630support HTTP caching, and does not perform any security checks. This method is utilized631by <em>res.download()</em> to transfer static files, and allows you do to so from outside of632the public directory, so suitable security checks should be applied.</p>633634<h3 id="res-download-file-filename-">res.download(file[, filename])</h3>635636<p>Transfer the given <em>file</em> as an attachment with optional alternative <em>filename</em>.</p>
220 unmodified lines
modified:docs/guide.md+4 added-2 removed
372 unmodified lines
373Used by `res.download()` to transfer an arbitrary file. 374375 res.sendfile('path/to/my.file');376377**NOTE**: this is _not_ a replacement for Connect's _staticProvider_ middleware,378nor does it perform any security checks, use with caution when using in a dynamic manner.377This is _not_ a substitution for Connect's _staticProvider_ middleware, it does not378support HTTP caching, and does not perform any security checks. This method is utilized379by _res.download()_ to transfer static files, and allows you do to so from outside of380the public directory, so suitable security checks should be applied.381382### res.download(file[, filename])383384Transfer the given _file_ as an attachment with optional alternative _filename_.
186 unmodified lines