Scanning files with ClamAV, while using different inputstreams

39 Views Asked by At

We have code that scans files upon uploading to AWS through our application. On the initial scan for an infected file when its a file inputstream the scan returns that a file is a virus.

Now here comes the problematic part. We also give the option to re scan a file because the virus database gets updated naturally. Upon re scanning the file is "safe". I realized that its because of the different input streams. It works when its a file input stream, doesnt work when its a EofSensory apachy inputstream or a buffered input stream. We are just calling the client with the inputstream and it gives different results for the same file depending on the kind of inputstream we provide.

And I'm clueless as to why, its surely the implementation of the inputstreams but I didnt find any usefully info regarding this.

Not sure how to fix this when its not an option to read the file into memory to create a file inputstream.

0

There are 0 best solutions below