How to Scan A File for Viruses in Salesforce Apex

Is it just me, or do you feel like every day you hear about a new form of cyber attack? To guard against these threats, we will be discussing how to use an API to automatically scan files for viruses, malware, and other threats in Salesforce Apex. The best feature of this particular virus protection is that it will identify zero-day threats that aren’t listed in the database of known malware signatures.

To kick things off, you will need to download and copy the /client folder into your Apex project:

Download Apex Client

For the next step, you can configure your API key and call the function with the following code:

And done! In sub-second time, you will have your result indicating if the file is clean; to block executables, invalid files, scripts, password protected files, and macros, be sure to set those parameters to false.

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store