You are here

function clamav_scan_file in ClamAV 6

Same name and namespace in other branches
  1. 7 clamav.inc \clamav_scan_file()

Scan a single file

Parameters

String $filepath:

Return value

int one of:

2 calls to clamav_scan_file()
clamav_elements_filefield_validate in ./clamav.module
Validator for filefield widget and imagefield widget. This is an implementation of a file upload_validator.
clamav_scan in ./clamav.inc
Scan a file and raise an error on the form element (if required).

File

./clamav.inc, line 37
API and helper functions for the ClamAV module.

Code

function clamav_scan_file($filepath) {
  switch (variable_get('clamav_mode', CLAMAV_DEFAULT_MODE)) {
    case CLAMAV_USE_DAEMON:
      return _clamav_scan_via_daemon($filepath);
    case CLAMAV_USE_EXECUTABLE:
      return _clamav_scan_via_exec($filepath);
  }
}