Add file validation and sanitization callbacks.