 <pre><code>var fs = require('fs') function(req, res) { var id = req.param('id') fs.exists('/private/img/'+id, function(exists) { if(exists) res.sendfile('/private/img/'+id) else res.end('err') }) } </code></pre>