Thank you. The solution was right in my face in the filter_bad_filename routine. > > if (-s "$entity->bodyhandle->path" <= $sizelimit) { > > $entity should always be defined, but $entity->bodyhandle or > $entity->bodyhandle->path might not be -- you need to check both. KAM