Content Type
-
Is there any way that I can retrieve the content type of a document without going into the regestry. I'm not working with HttpResponse so that's out. I need something like
FileInfo file =new FileInfo(path);
file.ContentTypeOnly file.ContentType does not exist in dotnet. Please Help
Stephen Lintott Bsc IT (RAU)
-
Is there any way that I can retrieve the content type of a document without going into the regestry. I'm not working with HttpResponse so that's out. I need something like
FileInfo file =new FileInfo(path);
file.ContentTypeOnly file.ContentType does not exist in dotnet. Please Help
Stephen Lintott Bsc IT (RAU)
I will assume you are using windows ... so you can usually cheat and use the file extension to determine the appropriate content-type. After that you could examine the file contents for known header information. However, the most accurate would be the Windows API: http://msdn.microsoft.com/en-us/library/ms775107(VS.85).aspx[^]
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego. -
I will assume you are using windows ... so you can usually cheat and use the file extension to determine the appropriate content-type. After that you could examine the file contents for known header information. However, the most accurate would be the Windows API: http://msdn.microsoft.com/en-us/library/ms775107(VS.85).aspx[^]
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.My C is not that great. Thanks for the link but can I ask you for an example of how the function is used.
Stephen Lintott Bsc IT (RAU)
-
My C is not that great. Thanks for the link but can I ask you for an example of how the function is used.
Stephen Lintott Bsc IT (RAU)
pinvoke.net for examples of how to use WinAPI's http://pinvoke.net/default.aspx/urlmon/FindMimeFromData.html[^]
-
pinvoke.net for examples of how to use WinAPI's http://pinvoke.net/default.aspx/urlmon/FindMimeFromData.html[^]
Tx
Stephen Lintott Bsc IT (RAU)