title: uploading files using express.js and node, limiting extensions
body: <p>I'm working on handling file uploads using express.js and node, and have the basic functionality working. What I need is to implement some security measures -- namely, to limit uploads to certain formats (PNG, JPEG). Is there an easy way to only allow certain formats? Would it go in the body-parser? </p>
  
  <pre><code>app.use(express.bodyParser({
      uploadDir: __dirname + '/public/uploads',
      keepExtensions: true   }));
  
  app.use(express.limit('4mb'));
  </code></pre>
  
  <p>Are there any other security measures that I should take into account? Is it generally a good idea to wipe EXIF data from the image?</p>
  
  <p>Thanks,</p>
  
  <p>Ben</p>