dcsimg
read a word doc using getBinaryStream()
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   K_McNeil
Posted On:   Thursday, May 20, 2004 12:50 PM

Is there a way to read an embedded Word Doc from an Access Database into a jsp page, or into Java? Maybe using a BufferedInputStream?

Re: read a word doc using getBinaryStream()

Posted By:   Sean_Owen  
Posted On:   Thursday, May 20, 2004 01:49 PM

The first step is to be able to connect to an Access database from your application -- have you configured a connection to Access, and can you successfully retrieve data?



Then you need to be able to read the bytes of the document as an array of bytes. Again if you are using JDBC properly this should be easy.



That's it, but I assume you want to do something with these bytes like write it to a client browser? It's as simple as writing the array of bytes to a JSP's output, but you will need to set some headers like "Content-Type" in order to make the browser recognize what you are sending as a Word doc, and open it in Word.

About | Sitemap | Contact