You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "g[R]eK" <gR...@warsztat.pac.pl> on 2004/08/20 01:08:36 UTC
Re[2]: Handle Non-HTML Files
<. Hi Kirk! .>
Thursday, August 19, 2004, 4:39:31 PM, you wrote:
KS> To clarify, I am refering to serving files that have
KS> been uploaded. I am not trying to generate these
KS> documents.
KS> --- Kirk Storer <ba...@yahoo.com> wrote:
>> I was wondering if there was an easy way to handle
>> non-html files. I have a few entries in my sitemap
>> such as this.
>>
>> <map:match pattern="images/*.gif">
>> <map:read mime-type="images/gif"
>> src="resources/images/{1}.gif"/>
>> </map:match>
>>
>> However, trying to guess all the different files
>> types
>> people will use ahead of time is nearly impossible
>> (.doc .xsl .mov .mpg .whoknowswhatelse)
>>
>> Is there an easy way to serve all unreconized
>> exstensions? eg. Assume they are all stored in a
>> certain directory.
>>
Yeah, it's simple, just use something like this:
<map:match pattern="uploaded/**">
<map:read src="uploaddir/{1}"/>
</map:match>
It will work properly, but there is a problem with mime-type. I think, there is
no good method, just do matches for common types (and there set mime-type) and
use above match.
--
Best regards
<. g[R]eK mailto:gReK@warsztat.pac.pl .>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Handle Non-HTML Files
Posted by Bhaskar Rathod <bh...@cs.unm.edu>.
qMax wrote:
>If i recall correctly, this common matching could be configured in
>cocoon/WEB-INF/web.xml ?
>Or what is purpose of those <mime-mapping>s ?
>
>
>
Yah that should work fine. The only issue would be you should be able to
determine or extract the resource directory name from request if you
store your resources by type.
I have images and audio files of different kind under my images/ and
audio/ directories so I go simplest route of different matchers for
them. Can I do it any other way more efficiently? Can I match using
mime types?
Regards,
Bhaskar
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re[3]: Handle Non-HTML Files
Posted by qMax <qm...@mediasoft.ru>.
Friday, August 20, 2004, 6:08:36 AM, gReK@warsztat.pac.pl wrote:
gRe> Yeah, it's simple, just use something like this:
gRe> <map:match pattern="uploaded/**">
gRe> <map:read src="uploaddir/{1}"/>
gRe> </map:match>
gRe> It will work properly, but there is a problem with mime-type. I think, there is
gRe> no good method, just do matches for common types (and there set mime-type) and
gRe> use above match.
If i recall correctly, this common matching could be configured in
cocoon/WEB-INF/web.xml ?
Or what is purpose of those <mime-mapping>s ?
--
qMax
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org