using input file to display thumbnail

is it possible to display a thumbnail when the user selects a image?  

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Certainly.  How would you like to display the thumbnail?  What does your app look like?  Send some code and tell me what you want and I'll help you.
Hugh McCurdyCommented:
I have two code examples, one in JavaScript and another in JQuery.  The javaScript one is a bit more complicated than it needs to be for a simple example but it works.  The JQuery one is simpler.

JavaScript --

JQuery --
What I'm asking is:

Are you trying to have a single image like this:

[main image]

And, then have a bunch of thumbnails like this:


And, when a user clicks a thumbnail then the main image becomes an enlarged version of the thumbnail they clicked?

Basically, just tell me specifically what you're trying to do.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

MK15Author Commented:
ok sorry for the lack of information.

what i am trying todo is have a button(<input type='file' name ='select_image'/>), where the user can select an image to upload.  The selected image is then displayed in a thumbnail image holder '<img src="selected_image" alt="image" />'.  I want todo this before actually submitting the form.

Hope this is clearer.

If you mean to select an image from their computer (from their local machine) and show it before it's actually uploaded from the server, this wouldn't be possible being as we can't show it in our web page without it first being placed on the server.  You could do an ajax upload and upload it as soon as they select it, then you could show it before submitting the form.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MK15Author Commented:
o ok, thats interesting, ill look into that.

thank you both for your help
To help you out, check out  It's a great ajax uploader.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.