This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes reading and displaying file of unknown type on the browser. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "reading and displaying file of unknown type on the browser." Watch "reading and displaying file of unknown type on the browser." New topic
Author

reading and displaying file of unknown type on the browser.

Kaustubh Patil
Ranch Hand

Joined: Aug 13, 2001
Posts: 164
I have to display a file from the server on to the browser. All I have the path of the file. The file may be anything, i.e. of any type.
I am reading the file in to bytestream array and writing that bytestream to the out stream of the response.
The problem here is that I cannot determine the content type of the response. As the file may be of any type i cannot hard-code the content type.
is there any way out of this ?
-Kaustubh.


Kaustubh. Mumbai, India.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reading and displaying file of unknown type on the browser.
 
Similar Threads
http / session cookies error
Servlet runs twice if I use IE 5.5
is setContentType Optional?
Incorrect file type when creating file from servlet
How to put an HTML file in a JEditorPane ?