----------------------------- Please read the FAQ! <http://java.apache.org/faq/> ----------------------------- please se the code below: if i want to have a byte[] dirctly displayed on html; how do i do it?? import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class tryMe extends HttpServlet { public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println("<HEAD><TITLE>Try now</TITLE></HEAD>"); out.println("<BODY> It is working"); //to show a pic which is hyper link to a file (this will work) out.println("<IMG SRC=\"/mcpd/servlets/chaseblue.gif\" WIDTH=140 HEIGHT=43 BORDER=0> "); //******** //to show a 3439 bytes pic from a byte[] (i did as below;but it does not work) //******** File fl = new File("c:\\tryme\\chaseblue.gif"); byte[] pic = new byte[(int)fl.length()]; out.println("<IMG SRC=" ) ; out.println( pic ); out.println(" WIDTH=140 HEIGHT=43 BORDER=0> "); out.println("</BODY></HTML>"); out.close(); } } ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com -- -------------------------------------------------------------- Please read the FAQ! <http://java.apache.org/faq/> To subscribe: [EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Archives and Other: <http://java.apache.org/main/mail.html> Problems?: [EMAIL PROTECTED]
