I want to know how to allow the user to upload some image of his/her choice from his/her local computer, plus adding some control on size and dimension limit.

I've seen this performed for instance in webs where they sell sunglasses. The movie allows you to upload your own picture of yourself so that you can virtually try them on.

How can I do this upload??