From: Matthew B. <mat...@ou...> - 2006-03-07 16:51:58
|
Matthew Buckett wrote: > Peter Crowther wrote: > >>>From: Matthew Buckett >>>resp.setContentType("text/comma-separated-values"); >> >> >>RFC4180 registers 'text/csv' as the MIME type for CSV. This works in >>IE6 and Firefox 1.06 on Windows, I've not tested it further. I'd not >>found another type that worked in both. > > > text/comma-separated-values came from the /etc/mime.types on my Linux > box. Thinking about this a little more you should probably do. > > resp.setContentType(BuildingServer.getInstance().getMimeType("marks.csv")) > > This way the mapping setup for the container will be used for CSV file > you generate, otherwise if we have to switch to fix a browser bug it > will mean changing the code in lots of places. > > In fact all resp.setContentType should probably do this that are used > for generated file. Looking at the code it seems like Bodington frequently sends XML back with a mime type of text/plain rather than the more traditional application/xml. Is there a reason for this? Examples of this include when it generates menu.xml and filelisting.xml files. -- -- Matthew Buckett, VLE Developer -- Learning Technologies Group, Oxford University Computing Services -- Tel: +44 (0)1865 283660 http://www.oucs.ox.ac.uk/ltg/ |