cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Stevens" <>
Subject RE: link to a file
Date Tue, 26 Sep 2006 14:23:50 GMT
>From: Roel Croonenberghs <>
>Date: Tue, 26 Sep 2006 16:12:28 +0200
>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

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}"/>
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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message