在C#中,我怎么能知道从一个byte []文件类型? [英] In C#, how can I know the file type from a byte[]?

查看:312
本文介绍了在C#中,我怎么能知道从一个byte []文件类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从上传的文件填充的字节数组。但是,在code的另一部分,我需要知道从字节[]上传该文件类型,所以我可以使正确的内容类型到浏览器!

I have a byte array filled from a file uploaded. But, in another part of the code, I need to know this file type uploaded from the byte[] so I can render the correct content-type to browser!

谢谢!

推荐答案

不知道,但也许你应该调查了解幻数的。

Not sure, but maybe you should investigate about magic numbers.

更新:
阅读关于它,我不认为这是非常可靠的,但。

Update: Reading about it, I don't think it's very reliable though.

这篇关于在C#中,我怎么能知道从一个byte []文件类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆