I would like to create a plugin that does a file scan for attachments upon upload. When it passes the scan, i want it to behave as per normal, but if it fails, i want to remove it, and prompt the user that the file uploaded has failed the scan. I am currently doing it by listening to the AttachmentCreateEvent, but there are some issues on the UI side. Does anyone know the best way to approach this?
I understand that there are attachment checker plugins available on the marketplace, but i would like to create my own as i need a custom way to scan my files.