Skip to content

Latest commit

 

History

History
64 lines (44 loc) · 1.55 KB

File metadata and controls

64 lines (44 loc) · 1.55 KB

Using ClamAV

If you want to use ClamAV for virus checking install appwrite/php-clamav.

composer require appwrite/php-clamav

You must be sure that ClamAV is installed on server and runs as root or as the same user as the webserver.

In the background the PHP uploads the file from your PC to the server. For exmpl: C:\mydoc.pdf to /tmp/qwd45rgrQWQ This /tmp/qwd45rgrQWQ temporary file must be accessible for clamav. If this is possible, the you can enable it.

$this->addBehavior(\FileUploader\Model\Behavior\UploadBehavior::class, ['image' => [
    // ... your other configs here ....
    'clamav' => [
        'enabled' => true,
        'socket' => '/var/run/clamav/clamd.ctl',
    ]
]]);

OR

$this->addBehavior(\FileUploader\Model\Behavior\UploadBehavior::class, ['image' => [
    // ... your other configs here ....
    'clamav' => [
        'enabled' => true,
        'host' => '127.0.0.1',
        'port' => '3310',
    ]
]]);

Note: if the ClamAV check is enabled the file MUST PASS. If the file is not accessible, ClamAV deamon is down or the file is dangerous, the upload fails.

clamav.enabled

Optional, default value: false

Turns on/off the virus checking with ClamAV.

clamav.socket

Optional, default value: null

The clamav deamon's socket.

clamav.host

Optional, default value: localhost

If the socket is null, the host and port is used.

clamav.port

Optional, default value: 3310

If the socket is null, the host and port is used.