I would like to prevent files from being saved, or remove them after saving from an image field associated with a Node, using NodeProcessor.

Unfortunately the data imported is not curated, it is scraped, so there is a high potential for bad data getting through. Such instances are BMP / AVI files being downloaded for Image Fields which do not allow either. Another example is files which download to zero file size.

I would like to filter the BMP / AVI files by extension, using a black list type approach, preferably before the files are downloaded.

However since I need to remove the zero size files after downloading anyway, I'm happy to remove the BMP / AVI files at this point as well if it's simpler.

What is a suitable hook or other method to achieve the above please?