简体   繁体   English

确定上传的文件是否是 asp.net 内核上的图像

[英]determine if uploaded file is image on asp.net core

Hello friends I want when a photo from the view to the controller It was sent to check that there must be a photo and the malicious file has not been uploaded Just like the answers sent to this question Determine if uploaded file is image (any format) on MVC朋友你好我想当一张照片从视图到controller 发送是为了检查一定有照片并且没有上传恶意文件就像这个问题的答案一样确定上传的文件是否为图像(任何格式)在 MVC 上

But this is for MVC but I want for asp.net core但这是针对 MVC 但我想要 asp.net 核心

You can achive this using Image File Headers To Verify Image Format details .您可以使用 Image File Headers To Verify Image Format details来实现这一点。 This answer will give you more details about the file header identification technique. 答案将为您提供有关文件 header 识别技术的更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM