From: Roel Croonenberghs <[EMAIL PROTECTED]>
Date: Tue, 26 Sep 2006 16:30:06 +0200
tnx, but does that means that for every different extension, I should
supply a mime-type?
It depends. The default reader will try and pick one automatically, but the
ones it knows depends on some JDK settings file (search the list archives, I
asked about this a while back). For others, you either need to add them to
this file, or just use a specific map:read that supplies it.
Andrew.
"Andrew Stevens" <[EMAIL PROTECTED]>
26/09/2006 16:23
Please respond to
[email protected]
To
[email protected]
cc
Subject
RE: link to a file
>From: Roel Croonenberghs <[EMAIL PROTECTED]>
>Date: Tue, 26 Sep 2006 16:12:28 +0200
>
>Hello,
>
>I have a dir in my WEB_INF folder where users can upload there files.
That
>works. But I want these files to be available for download. so I use a
>directory generator;
><map:generate type="directory" src="\WEB-INF\files\download">
>
>and I transform the result via xsl to produce a html with the links to
>these files.
>
>But what should I put in the href"" tag of a file? Because instead of
>letting the user download the file, cocoon tries to resolve the url in
the
>sitemap.
Well, if they're under WEB-INF you won't be able to link directly to them
anyway since the spec says web containers shouldn't serve up files under
there. You don't say what URL you're matching on to get the directory
listing, but assuming it's something like <map:match pattern="mydir"> then
you could just use relative links in the generated hrefs and add
<map:match pattern="mydir/*">
<map:read src="\WEB-INF\files\download\{1}"/>
</map:match>
to your sitemap. Depending on the filetypes you may also need to match
based on the extension and supply the relevant mime-type attributes on the
map:read elements.
Andrew.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]