Solved

using input file to display thumbnail

Posted on 2012-04-07
7
393 Views
Last Modified: 2012-04-07
Hi,
is it possible to display a thumbnail when the user selects a image?  

Thanks
0
Comment
Question by:MK15
  • 4
  • 2
7 Comments
 
LVL 14

Expert Comment

by:EMB01
ID: 37819111
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.
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 37819903
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 -- http://hugh.tekcities.com/hugh/program/web/jsThumb.php

JQuery -- http://hugh.tekcities.com/hugh/program/web/jqThumb.php
0
 
LVL 14

Expert Comment

by:EMB01
ID: 37819968
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:

[thumnbail][thumnbail][thumnbail]

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.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:MK15
ID: 37819974
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.

Thanks
0
 
LVL 14

Accepted Solution

by:
EMB01 earned 500 total points
ID: 37819982
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.
0
 

Author Comment

by:MK15
ID: 37819995
o ok, thats interesting, ill look into that.

thank you both for your help
0
 
LVL 14

Expert Comment

by:EMB01
ID: 37820025
To help you out, check out http://www.uploadify.com/.  It's a great ajax uploader.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now