How should I detect the MIME type of an uploaded file in ASP.NET?

in the aspx page:

<asp:FileUpload ID="FileUpload1" runat="server" />

in the codebehind (c#):

string contentType = FileUpload1.PostedFile.ContentType

Leave a Comment