title: Delete file after using response.download() in node.js?
body: <p>I'm working on an app which has a server that downloads files to the client's device using <code>response.download()</code>. (I'm using node.js, express, and fs) Once these files are downloaded, they are just taking up space, so I've tried calling <code>fs.unlinksync</code> after the download to get rid of them. No such luck, though: I just get the following error: <code>NOENT: No such file or directory.</code></p>
  
  <p>Here is the relevant server-side code:</p>
  
  <pre><code>app.get("/file", function(request, response) {
    var filename = request.query.f;
    var filePath = "public/" + filename
    response.download(filePath);
  //this is where I've tried putting fs.unlink
  });
  </code></pre>
  
  <p>Any help would be greatly appreciated. Thanks!</p>