In this article, I have explained how you can get width and height of an image before upload using javascript or jQuery to impose width or height constraint.
This article explains about HTML5 local storage and how to use local storage in javascript (storing and retrieving objects), instead of cookies to get better security and faster results.