Problems displaying CSV Files on Tomcat Server

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

ehmd
Ebase User
Posts: 53
Joined: Thu Sep 13, 2007 9:02 am
Contact:

Problems displaying CSV Files on Tomcat Server

#1

Postby ehmd » Thu Jan 03, 2008 2:27 pm

Problem

When Ebase is running on a Tomcat server and you attempt to display a .csv file in a pop up window ( e.g. FPL display 'http://localhost:3030/ufs/myfiles.csv' ), the file is displayed as a plain text file by the browser. Therefore you don't get the option to save the file or open it in the default application associated with csv files.


Solution

Tomcat by default does not have a mime type associated with .csv files, so you need to add it to the configuration.

Amend the file Ufs/UfsServer/Tomcat/Conf/web.xml to add a new mime-mapping entry:-

Code: Select all

    <mime-mapping>
        <extension>csv</extension>
        <mime-type>text/csv</mime-type>
    </mime-mapping>	
then restart the Tomcat server.
0 x

ehmd
Ebase User
Posts: 53
Joined: Thu Sep 13, 2007 9:02 am
Contact:

#2

Postby ehmd » Wed Jan 09, 2008 10:34 am

An alternative option is to use the Mime Type for Excel, as individual users PC's may not open the Text/CSV Mime Type correctly.

Code: Select all

    <mime-mapping>
        <extension>csv</extension>
        <mime-type>application/vnd.ms-excel</mime-type>
    </mime-mapping>
0 x


Who is online

Users browsing this forum: No registered users and 33 guests