Hi,

I have a pipeline that needs to serve up static files of any type from a particular directory. And yes, I know it'd be more efficient to just have the web server do it, but we don't control the server that hosts it and there's constraints on the configuration & deployment process that mean we have to do it this way. Previously, I was using a matcher for each file extension, and specifying the corresponding mime-type parameter in the map:read. However, I gather that if no mime-type is specified the resource reader is supposed to determine the mime type automatically using inputSource.getMimeType() on the (Excalibur) Source. So I tried replacing my multiple matchers with just

<map:match pattern="staticfiles/**">
<map:read src="files/{1}"/>
</map:match>

For PDFs and image files, this works just fine. However, MS Word/Excel/Powerpoint files are displayed as text/binary within the browser window rather than prompting to download or open them in the relevant application. SWF files are also displayed as text rather than in the Flash player/plugin. This appears to be because the Content-Type header is being sent back as "text/html; charset=ISO-8859-1" rather than e.g. application/vnd.ms-excel I haven't checked every file type we use (yet) so there may be others that also have the problem.

Is this a known limitation of the resource reader? Does it only recognise certain file types, or is there something else going on I'm not aware of (e.g. missing some configuration somewhere)? I'm using Cocoon 2.1.7, although the current SVN version on the 2_1_X branch doesn't appear to be any different.


Andrew.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to