Cfzip filter

cfzip( action="zip", source=ExpandPath('/store'), file="#getCode()", 
    filter=function( a ) {   
	    return false;

This way the zip file should be empty.

If I put “return true” I get the same result.

I mean it doesn’t seem to me that the function doesnt filters the files to put in the zip.
Maybe I didn’t quite understand how the “filter” attribute works.

Any help?

Lucee Version: lucee 5.3.9+133

Lucee compress version?

here are one of the test cases for filter, looks likes we don’t have one for action=zip with a filter yet?

@Roberto_Marzialetti I’ve checked this issue using the above code with lucee versions , and compress version When using cfzip tag with filter to “return false” it throw an error like “cannot create an empty zip file” and set cfzip Filter to “return true”, it created a zip file succesfully.

Can you please share your installed compress version?

I’m using this version of Lucee
How can I know which version of the extension I’m using?


@Roberto_Marzialetti To see which Compress Tags extension version you have installed, use server Admin (Extension-Application) page or the extensionList() function.

Thank you. I upgrade to
I’m investigating.
If i do:

cfzip( action="zip", source=dir, file=dir & "/../#getCode()", recurse="true", 
	filter=function( currPath ) {

		if ( currPath CONTAINS ".git" ) {
			return false;
		return true;

All folders in “.git” are created in zip, but files are not copied.
Would that be correct behavior?

I plan on doing a more in-depth report later.

Meanwhile, many thanks :smile: