Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to do a virus scan before post attachments in application,when they find a virus on to give up post attachments,otherwise proceed to upload.

I wonder if there are any APIs out there where you can send a file for scanning? I mean could we possibly upload, send off to a third party for scanning then receive a response?

share|improve this question

My advise is to configure a directory that your AV scans whenever a file appears there.

Save your attachment there, and attempt to read it after it's been saved. If it can't be read after it's been saved there, or if it doesn't exist there anymore, then it is a potential virus that needs to be examined further.

share|improve this answer

You can use the VirusTotal Public API or some similar service - but there are two problems,

  1. The feedback is not immediate so to tell the user that his action was refused, you'd have to let him wait for a while
  2. You'd have to upload the file to 3rd party server, which could be a privacy and bandwidth issue

Another approach is to scan the upload folder and check if file was deleted by antivirus - the feedback won't be instant either.

share|improve this answer
I agree with your analysis. However, I don't think VirusTotal is suitable in this context. One of the restrictions is "it can not be used as a substitute for antivirus products", which sounds like it would prohibit its use here. In addition, there is another restriction worth mentioning: the VirusTotal API is only for free services, not commercial products or services. There are also bandwidth limits which could be an issue. – D.W. Apr 16 '12 at 19:40 is currently in beta testing right now, which is a service to send a file to for scanning. Final pricing has not been determined yet, but it will be suitable for commercial services, vs virustotal which is intended only for personal, non-commercial use.

NOTE:This post is a product promotion by the developer.

share|improve this answer
welcome to Information Security. Please see the FAQ - if you are promoting your own service or product, you must disclose your connection with it. Besides that, can you expand a bit on how this is a solution to the question? – AviD Oct 18 '12 at 17:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.