Skip to content

sendFile requires absolute path or specified root#1

Merged
ttousai merged 1 commit into
ttousai:jsfrom
stvrbbns:patch-1
Nov 9, 2014
Merged

sendFile requires absolute path or specified root#1
ttousai merged 1 commit into
ttousai:jsfrom
stvrbbns:patch-1

Conversation

@stvrbbns
Copy link
Copy Markdown

@stvrbbns stvrbbns commented Nov 9, 2014

Just replacing "sendfile" with "sendFile" results in "TypeError: path must be absolute or specify root to res.sendFile". I think specifying an absolute path utilizing the __dirname Node.js global is best, rather than introducing the options object for sendFile.
http://nodejs.org/docs/latest/api/globals.html#globals_dirname
http://expressjs.com/api.html#res.sendFile

Just replacing "sendfile" with "sendFile" results in "TypeError: path must be absolute or specify root to res.sendFile". I think specifying an absolute path utilizing the __dirname Node.js global is best, rather than introducing the options object for sendFile.
http://nodejs.org/docs/latest/api/globals.html#globals_dirname
http://expressjs.com/api.html#res.sendFile
ttousai added a commit that referenced this pull request Nov 9, 2014
sendFile requires absolute path or specified root
@ttousai ttousai merged commit d516108 into ttousai:js Nov 9, 2014
@ttousai
Copy link
Copy Markdown
Owner

ttousai commented Nov 9, 2014

Thank you for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants