IContentAsyncContentType Property
IT Hit WebDAV Classes Reference
Gets the media type of the file.
Namespace:
ITHit.Server
Assembly:
ITHit.Server (in ITHit.Server.dll) Version: 11.3.10719
Syntax string ContentType { get; }
string ContentType { get; }
ReadOnly Property ContentType As String
Get
ReadOnly Property ContentType As String
Get
property String^ ContentType {
String^ get ();
}
property String^ ContentType {
String^ get ();
}
abstract ContentType : string with get
abstract ContentType : string with get
Property Value
Type:
StringThe MIME type of the file.
Remarks
The mime-type provided by this property is returned in a Content-Type header with GET request.
When deciding which action to perform when downloading a file some client applications and web browsers
(such as Internet Explorer) rely on file extension, while others (such as Firefox) rely on Content-Type
header returned by server. For identical behavior in all browsers and WebDAV clients your server must
return a correct mime-type with a requested file.
Examples The code below is part of 'WebDAVServer.FileSystemStorage.AspNet' C# & VB samples provided with the SDK.
public string ContentType
{
get { return MimeType.GetMimeType(fileSystemInfo.Extension) ?? "application/octet-stream"; }
}
Public ReadOnly Property ContentType As String Implements IContentAsync.ContentType
Get
Return If(MimeType.GetMimeType(fileSystemInfo.Extension), "application/octet-stream")
End Get
End Property
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also