Upload image using javascript
<p>im trying to get image as object of javascript on the client side to send it using jquery</p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;script language="JavaScript"&gt;
function checkSize()
{
    im = new Image();
    im.src = document.Upload.submitfile.value;
if(!im.src)
    im.src = document.getElementById('submitfile').value;
    alert(im.src);
alert(im.width);
    alert(im.height);
    alert(im.fileSize);

}
&lt;/script&gt;
   &lt;form name="Upload" action="#" enctype="multipart/form-data" method="post"&gt;
   &lt;p&gt;Filename: &lt;INPUT type="file" name="submitfile" id = "submitfile" /&gt;
   &lt;INPUT type="button" value="Send" onClick="checkSize();" /&gt;
   &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>but in this code only alert(im.src) is displaying src of file but alert(im.width),alert(im.height),alert(im.filesize) are not working properly and alreting 0,0,undefined respectively..kindly tell me how i can access image object using javascript </p>
