Getting a MIME type from a file extension in ASP.NET 4.5

Posted by Unknown

Getting a MIME type from a file extension in ASP.NET 4.5


if you are worked with MIME type file upload and download in ASP.NET,you have come across the situation of providing the  mime type from file extension.In general to provide mime type  file extension   we might have to maintain dictionary of mime type or need to write switch case of to accomplish this.


In asp .net 4.5 we have very good feature to provide  MIME type of file extension  by using the 
 System.Web.MimeMapping.In the api we need to use single line of call GetMimeMapping(string fileName)

Here is the documentation from the msdn MSDN documentation

Hope this will helps you.
Labels:

Post a Comment

 
test