Hey everyone!
I just wrapped up integrating the virus scanning feature from TextToAnything into the TTA extension.
Picture this: your user is uploading files into Directus, and instead of crossing fingers that they’re clean, a virus scanner stands guard only springing into action when needed. That’s exactly what the TTA Virusscanner brings to your workspace.
Here are the options:
-
Automatic Scanning
Once enabled through the TTA settings in Directus, every file you upload gets scanned automatically. -
Configurable Mode
You can choose between two modes:- Delete threats immediately, letting the system handle infections autonomously
- Route to a custom flow, where you define custom logic to handle the upload (for example with a notification to the uploader).
-
Scanning filter based on folders
Rather than scanning everything, you simply enable scanning on specific folders which prevents scanning files that might dont require a scan. (for example when generating a clean PDF trough the TTA extension)
-
Developer Hook
For deeper integration, you can invoke the scanner in your own Directus extensions using this snippet:const result = await globalThis.TTA.virusscanAsset(fileID);
The response JSON is straightforward:
// No virus: { "isInfected": false, "viruses": [], "timeout": false } // Example virus found: { "isInfected": true, "viruses": ["Eicar‑Signature"], "timeout": false }
I’d love to hear your thoughts or experiences!
Some usefull links: