title: Check filesize before uploading to file system
body: <p>Just a quick question,</p>
  
  <p>I have done a lot of research on this already but I have a different approach. </p>
  
  <p>My problem: I have a file uploader that works in all browsers using asp.net with VB. The issue is that our system only allows files to be uploaded that are no bigger than <strong>1mb</strong>. Now, using a check on the back-end, It will tell the user if the file is too big, and that they must upload a smaller file. However, the weird problem is that it will catch a file that is <strong>2-3mb</strong> over the limit. Not if a file is 20mb for example. If upload it, I will get a nasty debug error saying the max file size has been requested. </p>
  
  <p>What I wanted to do was a quick check on the front end to preven it from even being sent to the backend. </p>
  
  <p>I used:</p>
  
  <pre><code>$(function(){
      $('#File1').bind('change', function() {
            alert(this.files[0].size);
          });
  });
  </code></pre>
  
  <p>To check the file size. It works in chrome and firefox. But not IE. I heard using ActiveX could work if the user allows it in the privacy setting. </p>
  
  <p>I could use browser detection to say "hey, if IE do activeX else do the jQuery" But I am wondering if there is a more reliable method than ActiveX?</p>