Create Custom Upload Handler

In order to create a basic Upload Handler you should create a ASHX handler class, which derives from the RadUploadHandler class. If you want to implement some custom behavior you have to override some of the methods of the RadUploadHandler class and place your custom logic in them.

To learn more about the methods and properties of the RadUploadHandler class read this topic.

Here is an example of a custom upload handler.

Example 1: Custom upload handler

public class SampleUploadHandler : RadUploadHandler 
{ 
    public override string GetTargetFolder() 
    { 
        string targetFolder = base.GetTargetFolder(); 
        //Modify targetFolder 
        return targetFolder; 
    } 
    public override Dictionary<string, object> GetAssociatedData() 
    { 
        Dictionary<string, object> associatedData = base.GetAssociatedData(); 
        if ( this.IsFinalFileRequest() ) 
        { 
            associatedData.Add( "MyReturnParam", "MyValue" ); 
        } 
        return associatedData; 
    } 
} 

See Also

In this article