aspose file tools*
The moose likes Servlets and the fly likes a question about uploading an image.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "a question about uploading an image...." Watch "a question about uploading an image...." New topic
Author

a question about uploading an image....

Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
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...


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
hi dear
maybe u can use FRAMES/Javascript(to display the image)...
HTH
MB.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: a question about uploading an image....