How to find file size in javascript or jQuery
<p>I have a fileupload control, I want to validate the size of the file to 50kb before the done button is clicked.</p>

<p>I did some research on the internet and got this code</p>

<pre><code>&lt;script&gt;
   function A() {
      var oas = new ActiveXObject("Scripting.FileSystemObject");
      var d = document.a.b.value;
      var e = oas.getFile(d);
      var f = e.size;
      alert(f + " bytes");
   }
&lt;/script&gt;
</code></pre>

<p>I am using IE9 but this code is not working for me.
I am getting error on the line</p>

<pre><code>var oas = new ActiveXObject("Scripting.FileSystemObject");
</code></pre>

<p>How to solve this error?</p>
