aspose file tools*
The moose likes Struts and the fly likes How to preview uploaded image before inserting into the database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to preview uploaded image before inserting into the database" Watch "How to preview uploaded image before inserting into the database" New topic
Author

How to preview uploaded image before inserting into the database

v sat
Greenhorn

Joined: Sep 13, 2007
Posts: 7
Hello,
I have JSP/Struts page where I upload an image along with product information. after upload I want to preview product info including the uploaded image. I am finding trouble in getting the image for preview on the preview screen.
Thanks,


Venkatesan Sathiamurthy PMP
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
v sat wrote: I am finding trouble in getting the image for preview on the preview screen. ,


How did you try it, what didn't work..?


OCJP 6 (93%)
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

Please TellTheDetails. You can upload the image to a temp directory and in the rendered preview JSP page you can give the path of the image in the temp folder in the img tag...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
v sat
Greenhorn

Joined: Sep 13, 2007
Posts: 7
Hi,
I am using Google App Engine. I can't save images on physical folder in app engine.
What I am doing is, I have an action class with the property named photo of type String. I am using file-uploader to upload the image and save it in the photo variable as string
and at the same time open the image in the new window.




My requirement is to show the image along with the other product information. Not just the image in new window.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to preview uploaded image before inserting into the database