开发者

What would be the best way to verify a user uploaded file?

开发者 https://www.devze.com 2023-01-21 06:36 出处:网络
After a file开发者_高级运维 has been uploaded to the tmp folder, for example a pdf file, would php fileinfo mime check be enough to verify that the file is indeed a pdf file and is not infected?

After a file开发者_高级运维 has been uploaded to the tmp folder, for example a pdf file, would php fileinfo mime check be enough to verify that the file is indeed a pdf file and is not infected?

How do you verify that a user uploaded file has no virus?

so that I could let users download it?

My scenario is this: A user uploads a pdf file, I then let another user read his pdf file.


php fileinfo mime check be enough to verify that the file is indeed a pdf file and is not infected

No. It will tell you if it looks like a PDF file, but do no virus checking.

How do you verify that a user uploaded file has no virus?

With a virus scanner. There are plenty of commercial and non-commercial packages out there.


A mime check does not guarantee anything, to be reasonably sure that a file has no virus, you will have to pass it through a virus scanner, like for example clam on linux.

0

精彩评论

暂无评论...
验证码 换一张
取 消