try this, put the calculator.gif in the same directory as your showGif.jsp
file.

showGif.jsp
try
{

       String strConfigPath
=config.getServletContext().getRealPath(request.getServletPath());

       int intPos =0;
       intPos = strConfigPath.lastIndexOf("\\");
       strConfigPath = strConfigPath.substring(0,intPos);
       BufferedInputStream gifData = new BufferedInputStream(new
FileInputStream(strConfigPath + "\\calculator.gif"));
       byte[] buf = new byte[4096];
       int len;
       OutputStream output = response.getOutputStream();
       response.setContentType("image/jpeg");
       while((len=gifData.read(buf,0,buf.length))!=-1)
       {
           output.write(buf,0,len);
       }
} // end try
catch(Exception propErr)
{
      System.out.println(propErr.getMessage());
      propErr.printStackTrace();

} // end catch notFound

-----Original Message-----
From: Siva Sankara Reddy [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 12, 2000 3:36 PM
To: [EMAIL PROTECTED]
Subject: download image given by user


Hi,

I have to download a image file provided by user to my Databae server ..
so that i can show his image on my website.
Can anybody tell me the How can i do this??????/


Regards,
Sankar

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to