Cfzip filter

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

This way the zip file should be empty.
Right?

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 5.3.9.133 ,5.3.10.101-SNAPSHOT and compress version 1.0.0.13-SNAPSHOT. 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 5.3.9.133
How can I know which version of the extension I’m using?

Thanks

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

1 Like

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

cfzip( action="zip", source=dir, file=dir & "/../#getCode()#.zip", 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:

Sorry for reviving this post.
I’m using “filter” of cfzip to remove some directories from my zip.

	filter=function( currPath ) {

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

Files are not included, but directories are created empty.

Is it correct behavior?