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
Provenance
- Commit
8a337f1- Tree
e893af1- Author
Tj Holowaychuk <tj@vision-media.ca>- Committer
Tj Holowaychuk <tj@vision-media.ca>- Parent
dbc5bd4
3 files changed+9 added−5 removed
modified:docs/guide.1+1 added-1 removed
609 unmodified lines610 .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\.614+This 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])"617 Transfer the given \fIfile\fR as an attachment with optional alternative \fIfilename\fR\.618 .343 unmodified linesmodified:docs/guide.html+4 added-2 removed
624 unmodified lines625 626 <pre><code>res.sendfile('path/to/my.file');627 </code></pre>628 629-<p><strong>NOTE</strong>: this is <em>not</em> a replacement for Connect's <em>staticProvider</em> middleware,630-nor 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 not630+support HTTP caching, and does not perform any security checks. This method is utilized631+by <em>res.download()</em> to transfer static files, and allows you do to so from outside of632+the public directory, so suitable security checks should be applied.</p>633 634 <h3 id="res-download-file-filename-">res.download(file[, filename])</h3>635 636 <p>Transfer the given <em>file</em> as an attachment with optional alternative <em>filename</em>.</p>220 unmodified linesmodified:docs/guide.md+4 added-2 removed
372 unmodified lines373 Used by `res.download()` to transfer an arbitrary file. 374 375 res.sendfile('path/to/my.file');376 377-**NOTE**: this is _not_ a replacement for Connect's _staticProvider_ middleware,378-nor does it perform any security checks, use with caution when using in a dynamic manner.377+This is _not_ a substitution for Connect's _staticProvider_ middleware, it does not378+support HTTP caching, and does not perform any security checks. This method is utilized379+by _res.download()_ to transfer static files, and allows you do to so from outside of380+the public directory, so suitable security checks should be applied.381 382 ### res.download(file[, filename])383 384 Transfer the given _file_ as an attachment with optional alternative _filename_.186 unmodified lines