when an HTTP proxy detects that a file it is passing to a client is rejected by AV (for whatever reason - in your case looks like KAV is considering it to be "corrupted"), then it has few options.
depending on what has been sent and how, simply closing the connection may not cause the browser to see any problem with the file.
Consider the case where you're actually downloading an exe that actually contains a virus. the conundrum is that if we don't pass anything through to the client while we are downloading and scanning the file, then the client doesn't see any activity for a while, and the user will typically quickly give up waiting and hit refresh quite a few times before giving up and calling their sys admin.
So, we added drip-feeding, to keep the human attached to the browser happy that something was happening.
The downside of this, is that it's impossible to guarantee that whatever is sent through is actually safe. For this reason we wish to deprecate drip-feeding, and I wrote a draft internet specification for a resolution to this problem which has been largely ignored by the HTTP standards development community. I guess they don't consider it to be a problem.
https://datatracker.ietf.org/drafts/draft-decroy-http-progress/anyway. So lets presume we are stuck with dripfeeding, so the proxy has been feeding a file (75% of it) through to the client as it gets received, and further smaller chunks of it whilst it is being scanned so the client doesn't time out due to long scanning periods (scanning large archives can take a while).
Then we discover there is a virus.
If you just close the connection, if there was no Content-Length header received with the response from the server, and we weren't sending it chunked, then the client will think it got the whole file.
If we were sending it chunked, or there was a Content-Length header, (more likely), then the client will consider the download aborted, and may automatically retry.
Alternatively some clients will simply leave the file where it was being downloaded to, and you have a file on disk you may double click on to try and run.
So the decision was made to "poison" the file by sending something on the end, which also identifies it (if you look) as a virus.
In your case, it appears that the problem is that KAV is deeming the file corrupted, and quarantining it, this is causing the other problems. You can change settings in KAV as to what to do for corrupted files - e.g. pass it through. That will solve this problem.
we are currently working with Kaspersky Labs getting them to develop a streaming interface to their scanning engine so that we can identify a virus in stream, without having to accumulate the entire file before scanning it.