[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

using input file to display thumbnail

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

Thanks
0
MK15
Asked:
MK15
  • 4
  • 2
1 Solution
 
EMB01Commented:
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
 
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 -- http://hugh.tekcities.com/hugh/program/web/jsThumb.php

JQuery -- http://hugh.tekcities.com/hugh/program/web/jqThumb.php
0
 
EMB01Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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.

Thanks
0
 
EMB01Commented:
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
 
MK15Author Commented:
o ok, thats interesting, ill look into that.

thank you both for your help
0
 
EMB01Commented:
To help you out, check out http://www.uploadify.com/.  It's a great ajax uploader.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now