[opencms-dev] How to get the file size from items of cms:contentloop?

Mario Jäger m.jaeger at alkacon.com
Fri Jul 16 12:59:23 CEST 2010


Hi Daniel,

You should use:

<a href="<cms:link>${file}</cms:link>">${file}</a>

instead of:

<a href="${file}">${file}</a>

-- 
Kind Regards,
Mario.
 
-------------------
Mario Jäger
 
Alkacon Software GmbH  - The OpenCms Experts                    
http://www.alkacon.com - http://www.opencms.org


Mario Jäger schrieb:
> Hi Daniel,
>
> With this expression you can read the length of a resource in bytes:
>
> ${content.vfs.readResource['/index.html'].length}
>
>
> Try it with that format in your jsp, please:
>
> <cms:contentload ...>
>   <cms:contentaccess var="content" />
>
>   ...
>
>     <cms:contentloop element="Attaches"> 
>
>                 <c:set var="file"><cms:contentshow element="${content.value['Attaches/File']}" /></c:set>
> 		<a href="${file}">${file}</a>
> 		${content.vfs.readResource[file].length}
>
>     </cms:contentloop>
>
>     ...
>
> </cms:contentload>
>
>   


                 




More information about the opencms-dev mailing list