Changing a page's MIME type in LiveServer

30 views
Skip to first unread message

Jonathan W

unread,
Jan 27, 2010, 11:17:31 AM1/27/10
to RedDot CMS Users
Does anyone know how to change the MIME-type of a page in LiveServer.
I want to present a Comma Separated Value page with MIME type text/
csv. I've tried:

<rde-dm:attribute mode="write" attribute="request:rde-rd:content-type"
value="text/csv" tag="notag"/>

but it had no effect; indeed "request:rde-rd:content-type" doesn't
have any value normally.

Thanks,

Jonathan

Jonathan W

unread,
Jan 28, 2010, 10:34:51 AM1/28/10
to RedDot CMS Users
Our next attempt has been to specify the MIME type in the XSL
transformation:

<xsl:output method="text" media-type="text/csv" ... />

However when viewing the page in Firefox, the MIME type is still text/
html, so that doesn't appear to be working.

We're using the default WebLet, xchg.

Any more ideas?

Jonathan

Chuck

unread,
Jan 28, 2010, 1:25:16 PM1/28/10
to RedDot CMS Users
Jonathan,

You should be using the "rdeResponseMimetype" pre-defined "request"
attribute. I've confirmed in my DS 10.0 env. that the following
accomplishes what you want:

<rde-dm:attribute mode="write" attribute="request:rdeResponseMimetype"


value="text/csv" tag="notag" />

Using Firefox's developer toolbar, I see the following response
headers - notice that "Content-Type" is "text/csv":

Server: Apache-Coyote/1.1
Date: Thu, 28 Jan 2010 17:42:48 GMT
Expires: Thu, 28 Jan 2010 17:42:48 GMT
lsrequestid: 493
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/csv;charset=ISO-8859-1
Transfer-Encoding: chunked

200 OK

Enjoy!

-C

Jonathan W

unread,
Jan 29, 2010, 4:45:52 AM1/29/10
to RedDot CMS Users
Great, thanks! I should have looked further down the list of pre-
defined attributes rather than stopping at the first occurrence of
"MIME"!

J

Reply all
Reply to author
Forward
0 new messages