This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I need some advice on Image Upload in JSP's. I am currently working on an application where I have the image data available to me in a Byte.
We are using the following packages to implement Image Upload: org.apache.struts.action.* org.apache.struts.upload.FormFile
The FormFile object is converted into a byte by using the getFileData() method.
After the user selects the image to be uploaded and clicks OK:
1) We need to display the image in the same browser window in a thumbnail view. 2) We need to display this image on the next page also after the user submits his POST operation.
Currently I was trying to read about memorystreams in order to convert this image byte in to a image format to be dispalyed on the webbrowser.
We are using JSP, Pageflow, Weblogic 8.1 to develop this application.
Also we need to display this image from the memory first. As the image will be saved on the remote server only after the user chooses to publeh the AD untill such time we want to display the image in the browser window.
That is the reason I was thinking about MemoryStreams().
Do let me know what is the best way to handle images.
We're pleased to have you here with us in the JSP forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
You can change it here [ January 20, 2006: Message edited by: Ben Souther ]
Remember that JSP are for character output - images are binary data which can NOT be served correctly in a character stream. Your JSP must write an IMG tag in the HTML output where the src refers to a servlet that can format the correct response for the image request. This topic comes up frequently, browse around in recent posts. Bill