title: Is there any way to access non-file fields in a multipart/form-data POST before parsing the file?
body: <p>I'm writing some middleware to handle an image upload for my app (written in Node.js). I'm using the multiparty module and things have been going great, but I've encountered a problem. I'm trying to access some fields that have been included with the request before I parse the form (so that I can perform some validation). From the examples that I've found, fields included with a multipart/form-data POST are only available after the form has been parsed. Is there a way to get access to non-file fields included in the file upload request before parsing the file? </p>
  
  <p>The best way that I can think to do this is by including some customer headers. Would this be the best way to go about this? I want to avoid the expense of uploading the file if the validation on the field(s) fails.</p>
  
  <p>I'm using the <a href="http://loopback.io" rel="nofollow">Loopback</a> framework which is built on top of Express if that makes any difference.</p>
  
  <p>Thanks in advance for your help and happy Thanksgiving!</p>