Share via


StorageFile.ContentType Property

Definition

Gets the MIME type of the contents of the file.

public:
 property Platform::String ^ ContentType { Platform::String ^ get(); };
winrt::hstring ContentType();
public string ContentType { get; }
var string = storageFile.contentType;
Public ReadOnly Property ContentType As String

Property Value

String

Platform::String

winrt::hstring

The MIME type of the file contents.

For example, a music file might have the "audio/mpeg" MIME type.

Implements

Remarks

The ContentType property provides an interpretation of the file extension to determine the MIME type. It does not inspect the actual contents of the file. For example, renaming a text file (.txt) to have a .jpg extension will result in the ContentType being reported as image/jpeg.

Applies to