title: Check size of uploaded file in mb
body: <p>I need to verify that a file upload by a user does not exceed 10mb.  Will this get the job done?</p>
  
  <pre><code>var fileSize = imageFile.ContentLength;
  if ((fileSize * 131072) &gt; 10)
  {
      // image is too large
  }
  </code></pre>
  
  <p>I've been looking at <a href="https://stackoverflow.com/questions/1084740/how-check-file-size-on-upload">this thread</a>, and <a href="https://stackoverflow.com/questions/10445861/validating-for-large-files-upon-upload">this one</a>... but neither gets me all the way there.  I'm using <a href="http://www.matisse.net/bitcalc/" rel="noreferrer">this</a> as the conversion ratio.</p>
  
  <p><code>.ContentLength</code> gets the size in bytes.  Then I need to convert it to mb.</p>