上传文件到数据库病毒检查
作为我们要求的一部分,我们需要将一些文件上传到数据库。有什么方法可以在将这些文件保存到数据库之前对它们进行病毒扫描。
As part of our requirements, we need to upload some files to database. Is there any way we can do virus scan on those files before saving them to database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我个人在 Windows 计算机上使用 Free AVG 作为我的防病毒程序。它带有一个命令行扫描实用程序,允许您手动扫描文件。这可以很容易地从 Java 代码执行。
我确信一些其他防病毒应用程序也附带了其扫描仪的命令行版本。其中任何一个都可以通过 Java 代码轻松执行。
如果您使用的是 UNIX 计算机,您可能会质疑病毒扫描的这一要求,因为 UNIX 病毒非常罕见,并且防病毒软件不容易检测到有效病毒。这种特征的价值可能是不存在的。
I personally use Free AVG as my anti-virus program on my Windows machine. It comes with a command-line scanning utility which allows you to scan files manually. This could easily be executed from Java code.
I am sure some of the other anti-virus applications also come with command-line versions of their scanners. Any of these would be easily executed from Java code.
If you are on a UNIX machine, you may want to question this requirement of virus scanning since UNIX viruses are very rare and the effective ones are not easily detectable by anti-virus software. The value of such a feature may be non-existent.
您的服务器可能不会受到病毒的威胁;但是,您可能无论如何都想检查这些文件 - 使用 Windows 的客户端完全有可能上传受感染的文件,而另一个使用 Windows 的客户端下载该文件并感染自身。通过检查服务器上的恶意软件,您可以阻止其传播 - 因此即使恶意软件不直接攻击您的服务器,最终结果也是肯定的。。
如果您的服务器运行一些 UN*X-ish(Linux、BSD...),您可能需要查看 ClamAV 及其 Java 绑定 clamavj:它们提供各种扫描功能(例如,在给定的情况下按需或自动位置),甚至对于不同平台的恶意软件(例如,即使您的服务器运行 Linux,您也可以检查 Windows 病毒)。
Your server is probably not at risk from viruses; however, you probably want to check the files anyway - it is entirely possible for a Windows-using client to upload an infected file, and another Windows-using client to download it and infect themselves. By checking for malware at the server, you could stop it from spreading - so the net result is positive, even if the malware doesn't attack your server directly.
If your server runs something UN*X-ish (Linux, BSD, ...), you may want to look at ClamAV, and its Java bindings, clamavj: these provide various scan capabilities (e.g. on-demand or automatic in a given location), even for different-platform malware (e.g. you can check for Windows viruses, even though your server runs Linux).