Upload Image and preview

Hi

How to upload image and preview the uploaded image before inserting into the DB

Thank you
mmsreddyAsked:
Who is Participating?
 
bloodredsunConnect With a Mentor Commented:
Upload it using FileUpload, get the image as an inputstream and render it as an image for preview. Or store the resulting image in the session (possibly as a RenderedImage object) and then display that.

At what point you decide to store the image is up to you.
0
 
enachemcConnect With a Mentor Commented:
After you upload the image you would have to store it somewhere where it is directly accessible by the web application and serve it to the client as if it were already a part of you web app or store the image in memory (to be read session), create a servlet that when called will output this image (use output stream instead of writer) and provide the neccessary header (content type), and provide the image as having the source your servlet.
0
 
deeppraConnect With a Mentor Commented:
u can do that using the javascript .. get the file path and then dynamically update the image using javascript
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.