I have an idea for a software, which will allow users to upload their files for antivirus scan, receive scan results and perform corresponding action on user end. Is it legal to do so, taking that the antiviral software itself will not be distributed (i.e. i will buy and install it only on my server)?
Especially the first answer gives a good indication, but there is even more you have to keep in mind.
First you need to find out, what you are allowed to do with the Software you plan to use. Most companies have different licenses for Personal Use and Commercial Use. You will have to check the company's license for this. For example, you could try to find out if there are companies that offer licences where you 'pay-per-file' for example. This will keep your costs low in case of low interest in the product.
Second, you will have to think about other legal requirements, such as e-commerce requirements (what information are you required to give to the consumer, what can they expect from your product, to what extent can you guarantee the findings of your service?).
Third, and this part is getting increasingly important. What personal information will you process of the customer? Will you process everything, or is some information send to the software distributor as well? Will you hire a VPS? Or have a physical server?
Concluding, there are two (maybe three) important parts of your company. You will have to establish contracts with the Software distributor about the use of its software. Depending on the sort of server you use, you will have to arrange contracts with a cloud company. Third, you will have to standardise the contracts with the consumer/company about the service you are delivering. All of this should be complemented with providing the consumer/company information about how its personal information is being used.
I hoped to have provided you a sufficient answer. Don't hesitate to ask more if you want to know more.
You will have to read the license of the anti-virus software. Or better yet, ask a good lawyer to read that license.
What you are planning is a commercial use of the software, so any protections that the law might give to a consumer won't apply to you. When you use the software commercially, you are fully responsible for claiming with the words of the license.