Hi David,

There is an excellent article in Java Developer Journal (www.sys-con.com)
June/July 2000 issue talking about updoading/storing/display binary
datastream (ms-word file)using oracle BLOB and servlet.  You may find it
useful.

In my work, I have the following stuffs
1. a html file allows user browser to a file and upload to webserver.
something like
<form method="post" action="response_upload.jsp"
ENCTYPE="multipart/form-data">
<input type="file" name="fname">
<input type=submit value="upload">

2. the response_upload.jsp is like (I suggest you to use servlet here)
String sdata;
  String contentType = request.getContentType();
  String boundary =
  contentType.substring(contentType.indexOf("boundary=")+9);
  if ((contentType != null) && (contentType.indexOf("multipart/form-data")!=
-1))
  {
     try
    {
        ServletInputStream sis = request.getInputStream();
        int length = request.getContentLength();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        int c;
        for (int i = 0; i < length && (c = sis.read()) >= 0; ++i)
        {
          baos.write(c);
        }
        sis.close();
        sdata = baos.toString();
        baos.close();
        sdata = sdata.substring(sdata.indexOf("\r\n\r\n")+4);
        sdata = sdata.substring(0, sdata.indexOf("--"+boundary));
         out.println(sdata);

        // YOU CAN PUT YOUR IMPLEMENTATION OF STORE DATA TO DB HERE
       }
      catch(Exception e)
      {
         System.out.println( e.toString());
      }
    }

3. To display a ms-word file, you have to set
   response.setContentType("application/msword");

Hope this helps

J.Hu
-----Original Message-----
From: David Maurange [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 5:00 AM
To: [EMAIL PROTECTED]
Subject: JSP and Oracle Intermedia


hi,

I try to use the Oracle Intermedia cartridge to upload images from the
web client in my db and to put it in web pages.

I look over technet and oracle doc but there is no documents about.

Is someone already done that with JSP?

regards
David

===========================================================================
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