webapplication does not display tiff images

B

bauer

Hi,
I wrote a small web-application that displays tif image that are
retrieved from a database. I use Tomcat "4.1.24-LE-jdk14" as
web-container on a windows XP system and AlternaTiff as Tif Viewer
plugin. The applications works fine. But now I want to move to a unix
system where I use Tomcat "4.1.31". If I execute the same request on
the unix system the image is not displayed anymore but I see a
question dialog box asking me if I want to save or open the file. If I
choose open the binary file is opened in a text editor. I really don't
know why. The only difference I saw (when I used axis Tcp Tunnel
Monitor for monitoring the request datastream) is the response Header
from Tomcat

unix:
"HTTP/1.1 200 OK
Content-Type: image/tiff;charset=ISO-8859-1
Transfer-Encoding: chunked
Date: Tue, 26 Oct 2004 07:44:58 GMT
Server: Apache-Coyote/1.1"

windows:
"HTTP/1.1 200 OK
Content-Type: image/tiff
Transfer-Encoding: chunked
Date: Tue, 26 Oct 2004 07:55:18 GMT
Server: Apache Coyote/1.0"

Here is the code I used to generate the Tif page

<%@ page import="java.io.*"%><%@ page import="de.tui.tas.jsp.*,
java.util.*"%><%
//contains current Tif document information
DocumentBean docBean = (DocumentBean)
session.getAttribute("DOCUMENT_BEAN");

if ( (docBean != null) && (docBean.getCurrentDocument() != null)
&& (docBean.getCurrentDocument().getDocumentPage(0) != null))
{

DocumentPage DocPage = docBean.getCurrentPage();
String sFileName = DocPage.getPhysicalFileName();
String contentType = DocPage.getContentType();

//content type is currently always "image/tiff"
response.setContentType(contentType);
ServletOutputStream outter = response.getOutputStream();

try {
File file = new File(sFileName);
byte[] byteContents = new byte[(int)file.length()];
FileInputStream in = new FileInputStream(sFileName);
int retcd = in.read(byteContents);
in.close();
outter.write(byteContents);
outter.flush();
}
catch (Exception e)
{
e.printStackTrace();
}
}
%>

regeards,
Stephan.
 
H

Heiner Kücker

bauer wrote
I wrote a small web-application that displays tif image that are
retrieved from a database. I use Tomcat "4.1.24-LE-jdk14" as
web-container on a windows XP system and AlternaTiff as Tif Viewer
plugin. The applications works fine. But now I want to move to a unix
system where I use Tomcat "4.1.31". If I execute the same request on
the unix system the image is not displayed anymore but I see a
question dialog box asking me if I want to save or open the file. If I
choose open the binary file is opened in a text editor. I really don't
know why. The only difference I saw (when I used axis Tcp Tunnel
Monitor for monitoring the request datastream) is the response Header
from Tomcat

Your client unix os dont knows to tiff file format.
What is the browser?
Look for a browser plugin to view image format.

Heiner Kücker
Internet: http://www.heiner-kuecker.de
JSP WorkFlow FlowControl Navigation: http://www.control-and-command.de
Expression Parser: http://www.heinerkuecker.de/Expression.html
 
A

Ann

bauer said:
Hi,
I wrote a small web-application that displays tif image that are
retrieved from a database. I use Tomcat "4.1.24-LE-jdk14" as
web-container on a windows XP system and AlternaTiff as Tif Viewer
plugin. The applications works fine. But now I want to move to a unix
system where I use Tomcat "4.1.31". If I execute the same request on
the unix system the image is not displayed anymore but I see a
question dialog box asking me if I want to save or open the file. If I
choose open the binary file is opened in a text editor. I really don't
know why. The only difference I saw (when I used axis Tcp Tunnel
Monitor for monitoring the request datastream) is the response Header
from Tomcat
Did you move AlternaTiff too?
 
H

Hal Rosser

Most browsers will display GIF, JPG, and PNG.
I don't think tiff is supported, so it won't show in the browser.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top