This is impossible to do in a cross-browser way.
The only cross-browser way that comes to my mind (but is not simple) is to upload the file ajax style, render that image (could be hidden) and get its size with img.width
and img.height
.
Hope this helps. Cheers