title: API file upload (Server Side) check if there is an actual file before trying to read it
body: <p>I have created an Web-API 2 Post method to upload a physical file to the server. I noticed I could still call that API without passing an actual file.  </p>
  
  <p>So when the server side runs these 2 lines of code  </p>
  
  <pre><code>var sp = new MultipartFormDataStreamProvider(fileName);
  await Request.Content.ReadAsMultipartAsync(sp);
  </code></pre>
  
  <p>When the client (not a browser, not fiddler) calls the API but does not upload a file, I get an exception (that is trapped).</p>
  
  <p><strong>QUESTION</strong>:<br>
  Is there a way to check if the Request carries a file, <strong>BEFORE</strong> calling the <code>Request.Content.ReasAsMultipartAsync</code>??</p>
  
  <p>My problem is NOT to trap the exception, but to find a clean way to learn before I get into the exception that there was no file so that I can notify the calling client about it.</p>