How change limit file size of Clamd service for nclam

5k Views Asked by At

Default Limits: File size limit set to 26214400 bytes. If i scan file size > 25mb, it will occur error.

The maximum stream size of 26214400 bytes has been exceeded.

I try change:

 public ClamClient(string server, int port)
        {
            MaxChunkSize = 131072; //128k
            MaxStreamSize = 209715200; //200mb ,- 26214400; //25mb
            Server = server;
            Port = port;
        }

But it occur error when scan file:

Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.

How change limit file size of Clamd service in Window?

Thanks all.

1

There are 1 best solutions below

0
On

You need to change nclam config ("clamd.conf"):

StreamMaxLength 50M

You also have to change the ClamClient instance with a higher MaxStreamSize:

var client = new ClamClient("localhost", 3310)
{
     MaxStreamSize = 52428800
};