Local database reading edition
Image uploading through servlet
Reconstructed from database records, not a captured original forum layout. Dates and display names are retained as recorded; timezone and real-world identity are not inferred. Historical advice, contact details and offers are not current. Original markup is shown as inert text.
Forum index · Java - GUI/JSP/Servlet
Opening post
Gayatri · 2001-04-08 23:42:28
Hi,
I'm facing some problems while uploading an image file in servlet.The image's picture quality is getting spoiled.Can anyone help me how to regain the resolution of the image.
thank u
software Programmer
Reply 10
Asha · 2001-04-11 15:47:09
I am not clear about what caused your problem.
Basically, you would have to do the following steps to send the image:
<i>
Use response.setContentType("image/gif") to tell the browser what the content type of the response is going to be
Use response.setContentLength(...) to tell the browser how many bytes it will be getting (i.e. the length of the image in bytes)
Use response.getOutputStream() to grab an output stream that goes back to the browser
Write the bytes of the image to the output stream
Flush the output stream.</i>
Check if you are missing any of the above step. Your image tag might be having wrong width and height.
Asha Balasubramanyan
http://www.ammu.org
Edited by - asha on April 11 2001 3:50:49 PM
Reply 12
rameshs · 2001-04-17 23:49:43
There must be some problem in image file. Your image file size be as small as possible.
At the same time it should look good also.
Ramesh
Ramesh Chandra Sahoo
Reply 18
Asha · 2001-04-18 22:57:52
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
There must be some problem in image file. Your image file size be as small as possible.
At the same time it should look good also.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
I guess you are addressing a totally different problem. Here the concern is w/ to Java Servlet uploading an Image. The Image gets corrupted in the process of uploading in Servlet. This is different from a Html page displaying an Image.
Asha Balasubramanyan
http://www.ammu.org
Source notes
MyCommunity/nandighosha.org.zip!/forum/tools/snitz_forums_2000.mdb
Table: FORUM_TOPICS + FORUM_REPLY · record IDs: 91, 10, 12, 18