Gets the MIME content type of a file sent by a client.
Namespace:
EasyAlgo.EAUploadAssembly: EasyAlgo.EAUpload (in EasyAlgo.EAUpload.dll)
Version: 1.3.0.0
Syntax
| C# |
|---|
public string ContentType { get; } |
| Visual Basic (Declaration) |
|---|
Public ReadOnly Property ContentType As String |
Field Value
Type: System..::.StringThe MIME content type of the uploaded file.
Examples
The following code example shows how to loop through all the files in the uploaded file collection and take action when the MIME type of a file is "video/mpeg".
CopyC#
CopyVB.NET
Upload _CurrentUpload = UploadsManager.GetUpload(); UploadedFileCollection _FileCollection = _CurrentUpload.UploadedFiles; for (int i = 0; i < _FileCollection.Count; i++) { if (_FileCollection[i].ContentType == "video/mpeg") { //do something useful } }
Dim Counter As Integer Dim _CurrentUpload As Upload = UploadsManager.GetUpload Dim _FileCollection As UploadedFileCollection = _CurrentUpload.UploadedFiles For Counter = 0 To _FileCollection.Count - 1 If _FileCollection(Counter).ContentType = "video/mpeg" Then 'do something useful End If Next Counter
