• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet to display MS-Word file in another Server  RSS feed

 
siva krishnan
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Our web application is deployed in a Solaris server.
We need to be able to read word/excel files located in another file server(Win2000) and display to clients.
Due to security considerations, the files should not be downloaded to the Solaris server for purposes of reading the contents.
Is there any way of writing a servlet to read the file as a stream and display it to client ?
Any sample code that anyone already has that achieves similar functionality would be great.

Cheers
Siva
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you can write a URL to the doc/xls that you want to display in the servlet, then you can open a URLConnection to it and get an input stream. From that do what you want (copy it to the response output stream, or something else...):


More or less...
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve's suggestion is good.

Out of curiosity, what security threat are MS/Office files on a Solaris box?
I would think they'd be more dangerous on the Windows box.
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you still need to know how to stream it back so that it opens up correctly?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!