I have some application. User can upload files, i save it on disk, and return it, when user want. I need implement some protection for uploaded files for viruses. I found 3 solutions for this problem:
- Use online antiviruses
- Install antivirus on my server and check uploaded file from command line
- Integrate antivirus by sdk or api.
I don't like first solution, because i send my files and private info for other server. Second solution i think is best, but i don't know how correctly implement it. Last solution good, but i can't find any good and famous antiviruses, who has java api.
Please, give me some direction for solve this problem. Mb some advice or literature. What is best way for solve it?
First, you have to check what kind of API does your installed antivirus software provides.
If there is any Java API provided (like AVG API) then you have to use it as below:
If no Java API is provided by the installed antivirus software, then you can still invoke it using command line, as below:
There is an interesting article for your reference: Implementing an Anti-Virus File Scan in JEE Applications
Hope this helps you.