I think this is similar to my query a while ago, you make the JSP you
produce an actual winword file by streaming out the bytes..

I'd recommend a servlet, but either would go along the lines of:

response.setContentType("application/msword");
response.setContentLength(bytesRead);

OutputStream out = response.getOutputStream();

out.write(bytes, 0, bytesRead);
out.flush();

Hope this helps,
Pete Dolukhanov


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]] On Behalf Of Aidil Fitri
Sent: 22 March 2002 01:53
To: [EMAIL PROTECTED]
Subject: How to open a blob file in Winword that open automatically?

Hi everybody..:).

I want to ask a question.

How to grab a blob file,(eg. Test.doc) from the database..
and open the file in an Editor, (eg WinWord) that open automatically
from a jsp...

I manage to get the blob file from the database.

   ResultSet rs = stmt.executeQuery();

   while(rs.next())
   {
    byte bytes[] = new byte[1024*1024];
    int bytesRead = 0;

    //------
    Blob blob = rs.getBlob(2);
    InputStream in = blob.getBinaryStream();

but how to put it in the WINWORD, and HOW to open the Winword
automatically?

Can anybody help me with this?..

Thanks.

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to