• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

a question about uploading an image....

 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey guys.. my question is this:
I have successfully developed a site in which a user can upload an image to the server. I'm using jspsmartupload and it's working fine..
now the requirement is: I must modify my form and allow a user to choose the image (browsing the local directory, and choosing the file). Once the user selects the image, I want it to be displayed on the right side of my form. This is without pressing the submit button .
It's like a preview-upload all-in-once. Is that possible to achieve?
any suggestion is highly apprecciated...
 
Author
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi dear
maybe u can use FRAMES/Javascript(to display the image)...
HTH
MB.
 
Sheriff
Posts: 67752
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
There really isn't any way to do that unless you go down the signed applet route. Remember that the page is composed on the server (including the reference to theimage in the img tag) and then sent to the client for rendering. Once on the client, (except in the case of a trusted client-side active component like an applet or activex control) you have no access to the file system of the client.
There are a number of tricks you could use to avoid page refresh in order to display the image (especially if you are not too concerned with legacy browsers), but you're going to have to upload the image first.
hth,
bear
 
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic