Is there any client side mechanism to detect, if file download is blocked by antivirus?

Sandeep 1 Reputation point
2020-12-02T05:10:04.037+00:00

We are working on ASP.NET web application -ASP.NET C# at server side and JQuery/JavaScript on client side . We download some exe files from server, however sometime antivirus block the download of exe file. Is there any client side mechanism(JavaScript/JQuery) which can detect file has been blocked by antivirus?

If it is not possible by jQuery or JavaScript then is there any other way to find out, if downloaded file is blocked by antivirus.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,417 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. XuDong Peng-MSFT 10,341 Reputation points Microsoft Vendor
    2020-12-03T06:07:12.637+00:00

    Hi @Sandeep ,

    As far as I know, there is no similar mechanism on the client side that can achieve your purpose. I think what you should do is to catch exceptions that may occur when downloading files.

    Use a try/catch block and catch the UnauthorizedAccessException.

    This won't tell you if the AV caught it, and neither should you check: that's the problem of the user and their AV.
    If your program was denied access to some of the user's resource and you believe you had a legitimate reason to access that resource, inform the user with a nice text boxt and let them sort it out with their AV. You can for example suggest that your downloader be in the AV's trusted program list.

    Best regards,
    Xudong Peng


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments