clamav.scan - Scan files with ClamAV

clamav.scan.check_for_malware(file: UploadedFile) None

Scan the file for malware.

If CLAMAV_ENABLED is False, return early.

Raises:
  • ValidationError – If the file contains malware.

  • ConnectionError – If the connection to ClamAV cannot be established or if there is a

  • communication error.

  • ValueError – If the file is too large to be scanned.