Tomcat 8 unable to download excel or image

421 views Asked by At

Recently I have migrated one of my apps from Tomcat 7 (in Ubuntu 12.04.2) to 8.5 in Ubuntu 20.04.3 .

In Tomcat 8.5, it is failing to download a binary file like excel/image by clicking the download button on the webpage which is linked to a url like http://xx.yy.zz.pp:8080/testsite/bin/test.xls . It does not give any message. If this url is tried from the browser it shows only junk (binary) characters. Testing the url with "curl -s -I" shows content-type as text/html - though conf/web.xml under tomcat folder has proper mime-type mapping application/vnd.ms-excel against xls.

This works in Tomcat 7 without any issue.

It can show a normal text file using a similar url without any issue.

From Ubuntu command prompt checking "file --mime-type test.xls" shows application/vnd.ms-excel . But tomcat is failing to identify that .

0

There are 0 answers