check image size before upload
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5270460/checking-image-size-before-upload">checking image size before upload</a>  </p>
</blockquote>



<p>I want to check image size before upload photo using JavaScript</p>

<ul>
<li>Max width = 1024px</li>
<li>Max Hight = 800px</li>
</ul>

<p>How can this be done?</p>

<pre><code>&lt;script&gt;
&lt;!-- HERE MY QUESTION --&gt;
&lt;/script&gt;    
&lt;form name="forms" action="#" method="post" enctype="multipart/form-data" onsubmit="return check();"&gt;        
    &lt;input type="file" name="img_name" /&gt;&lt;br /&gt;
    &lt;input type="submit" value="Upload" /&gt;        
&lt;/form&gt;
</code></pre>
