RadUpload for ASP.NET

RadUpload Send comments on this topic.
AllowedMimeTypes Property
See Also  Example
Telerik.WebControls Namespace > RadUpload Class : AllowedMimeTypes Property


Gets or sets the allowed MIME types for uploading.   

 

Namespace: Telerik.WebControls
Assembly: RadUpload (in RadUpload.dll)

Syntax

Visual Basic (Declaration) 
Public Property AllowedMimeTypes As String()
Visual Basic (Usage)Copy Code
Dim instance As RadUpload
Dim value() As String
 
instance.AllowedMimeTypes = value
 
value = instance.AllowedMimeTypes
C# 
public string[] AllowedMimeTypes {get; set;}

Return Value

The default value is empty string array. In order to check for multiple mime types you should set an array of strings containing the allowed MIME types for uploading.

Example

This example demostrates how to set multiple allowed MIME types to a RadUpload control.
Visual BasicCopy Code
' For example you can Get these from your web.config file
Dim commaSeparatedMimeTypes As String = "application/octet-stream,application/msword,video/mpeg"

Dim allowedMimeTypes As String() = commaSeparatedMimeTypes.Split(",")
RadUpload1.AllowedMimeTypes = allowedMimeTypes
C#Copy Code
// For example you can get these from your web.config file
string commaSeparatedMimeTypes = "application/octet-stream,application/msword,video/mpeg";

string[] allowedMimeTypes = commaSeparatedMimeTypes.Split(',');
RadUpload1.AllowedMimeTypes = allowedMimeTypes;
    

Remarks

Set this property to string.Empty in order to prevent the mime type checking.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also