Why does the FindMimeFromData function from Urlmon.dll return MIME type “application/octet-stream” for many file types?

前端 未结 2 1399
旧时难觅i
旧时难觅i 2021-01-11 19:07

Why does the FindMimeFromData function from Urlmon.dll return MIME type “application/octet-stream” for many file types, whereas checking MIME type by file extension (I.e. ag

2条回答
  •  再見小時候
    2021-01-11 19:52

    There's a nice solution here: https://stackoverflow.com/a/9435701/74585 which tries to determine the file type from the registry (by file extension?) if FindMimeFromData returns "application/octet-stream" "text/plain" or nothing at all.

    Here's a .NET file type detecting library http://filetypedetective.codeplex.com/ but it only detects a smallish number of files at the moment.

提交回复
热议问题