title: expressjs: Sending a file from parent directory
body: <p>I would like to use expressjs's sendfile to send a file from a parent directory of the script file. What I tried to do is this:</p>
  
  <pre><code>app.get('/', function(req, res){
      res.sendfile('../../index.html');
  });
  </code></pre>
  
  <p>I get a forbidden error because apparently, sendfile does not trust path traversal. So far I've been unable to figure out how to change the directory for files sent via sendfile. Any hints?</p>
  
  <p>Edit: I was kind of tired when posting this, in fact it is kind of easy. I'll leave it here in case anybody else stumbles upon this. There's an option parameter for sendfile that allows you to do just that, like so:</p>
  
  <pre><code>app.get( '/', function( req, res ){
      res.sendfile('index.html', { root: "../../"});
  });
  </code></pre>