Javascript - 文件上传securtiy检查maleware,病毒

时间:2015-05-12 12:48:45

标签: javascript angularjs security file-upload

在应用程序中,多个用户可以上传文件。我们需要检查他们是否不会将平台上的男性软件或病毒上传。是否存在执行此操作的现有模块或方法?

1 个答案:

答案 0 :(得分:2)

There are several different ways to check if a file is what the user claims it is. Blueimp has a fairly popular jQuery plugin that should do the job. This plugin does the work of checking that the actual file contents and type match the extension and mime-type provided by the user.

https://blueimp.github.io/jQuery-File-Upload/

You can probably find others if you look. However, I should say that you should really be doing this validation on the back-end. As a general rule, don't do front-end validation for security; do it for user experience.

If you're using something that DOES protect against the sort of thing I describe (REST with JWT or some such) let me know and I'll ammend my answer.