Obviously, you need to check the file with antivirus and parse its answer. How exactly - choose for yourself. From unobvious solutions:
1) Installed somewhere drwebd, you can feed the file to it using your own protocol, from there you can get an answer. In this case, the file itself is not necessary to drive on the sockets, if it is accessible to the daemon through the file system. The description of the protocol and examples of clients with source codes are included in the delivery of drwebd. This solution may be better because you do not need to run a separate scanner for each file, which will initialize each time, load the databases, you can maintain queues from scanned files without duplicating unnecessary processes, etc.
2) Create a multipart/form-data at http://online.drweb.com/result/ and parse the answer. POST details - in forms that can be downloaded here (in fact, there is nothing necessary except for one input type="file" name="file" ). For this option, you do not need to install your antivirus at all.
Surely there are similar solutions from other antivirus vendors.
The user uploads the file to the server, when going to the page with the file, I need to check it for viruses,
Only one remark. In the general case, the file should be checked immediately after downloading, and only after that it is necessary to make a decision: put it into an accessible area and issue a link, or not. That is, no "go to the page with the file" if it should not be infected.