• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

image preview

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


By using this i will get a browse box and a browse button . the moment i browse the image , i will get the path in the browse box.

what i want is the moment the path comes in the area then automatically the preview of the image should come in the specified area or there itself. how can i do it. i 've got few scripts in net but they are of no use. i am using firefox.

i want to see the preview of the image before i upload it to the database.

-thank you
 
Ranch Hand
Posts: 129
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
sasank manohar
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you , but its not working. it is giving a blank box.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sasank manohar wrote:Thank you , but its not working. it is giving a blank box.


It would be helpful is you were to post what the src is being set to.
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
off the bat ... try this;



Also, in above code, did you ensure that you're getting the "file" when you click on it? because on the snippet provided to you above I see that file path is non-relative ...

Trilochan
 
sasank manohar
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all i apologize for my very late response , what can i do , life is like that...hectic.

thank you ramnna and trilochan for your inputs.

i am trying to upload images from

C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\winter.jpg

but next time it can be D:\wallpapers\xyz.jpg or gif
so how can i give path, because image loading will be done by the user/client , so path is not in our hands.

the following code , tried individually didnot work.


also this as i already told you didn't work, its just giving blank box with specified sizes.


the html is ,




any help would be appreciated.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think that JavaScript has access to the contents of a file upload field for security reasons, so this may not be possible.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is impossible to do it with today's browser security settings. If you want to do a preview you need to use Flash or an Applet OR upload it to a temp section on your server.

Eric
 
sasank manohar
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you ulf and eric.

is it possible with ajax ? I heard that it is possible with ajax, so how much is it true ?please tell me.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajax == JavaScript == Nope
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic