I am trying to design a module in which I would like to show a preview of the image to the user before he uploads the image to database.
I have found a solution which wo
I concur with the nay-sayers who have already answered - local files are off limits by design.
But, if you are really committed to this preview-before-upload feature, and willing to include some bumpy UX, you might circumvent the local/server question and...
...use an accompanying AIR application to handle image uploading for your web app.
Create a simple AIR application that allow users to select local images and displays them in thumbnails without uploading them.
You can check to see if user's have the app installed, at which point you can prompt them to install or launch it if it's already installed (see here for more on that). You could allow them to opt out and use a fallback upload system without thumbnail previews as well.
Once the images are selected and reviewed (or even resized or otherwise processed), the AIR app could upload them to your server directly.
It's insane, I know, and probably doesn't fit your skill-set or expectations (based on the tags on this question) but I think it would work.