Help coderanch get a
new server
by contributing to the fundraiser
  • 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

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: 67750
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
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic