Always something new to find in Railo

August 20, 2009 · By Gert Franz · No Comments

Even for myself this was absolutely stunning. I decided to write a series of tips for Railo and by doing this I stumbled across a problem Andrea Campolonghi had, who writes the Railo AJAX tag extensions we will include very soon. The problem was or is that he needed to read the content of a zip file that is inside another zip archive. Now how to do that without unzipping it into a local folder.So here's problem and the solution (I must say I was very astonished that it worked, but somehow it seemed logical as well): <cfdirectory action="list" name="getFiles" directory="zip://d:\myzipfile.zip!content.zip" recurse="true">
This fails with the following error:
file [d:\myzipfile.zip!content.zip] exists, but isn't a directory
So what to do?
Well this is the solution:

<cffile action="copy" source="zip://d:\myzipfile.zip!content.zip" destination="ram://content.zip">
<cfdirectory action="list" name="getFiles" directory="zip://ram://content.zip" recurse="true">
<cfdump eval=getFiles>
<cffile action="delete" file="ram://content.zip">

So I combine the RAM and the ZIP resource in one directory address. You can only combine different resources in order to use them at the same time. I think that's really cool!

Tags: Extension · HowTo · Railo 3.1 · Tips

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment

Leave this field empty: