I think you need a servlet to do this. Since a Word doc contains binary
characters a JSP won't be able to output the file. JSPs can only output
text. It should be pretty straightforward to output the BLOB data from a
servlet. You should set the content type to application/msword and that
should give the browser the information that it needs to handle it as a
Word doc. I think it will know enough to use either MSWord or Winword to
open the file. If not, try application/winword. I doubt that is going to
work though.
-Richard
At 06:53 PM 3/21/2002 -0700, you wrote:
>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