//Client Side
{
............
private void radFileUploder_UploadFinished(object sender, Telerik.Windows.Controls.FileUploadedEventArgs et)
{
// string dataInStringFmt;
var returnedData = et.HandlerData.CustomData["imgLastChunkData"];
// do something with returnedData
}
...................
}
// Server Side
namespace XceedAdminister.Service
{
public class imgHandler : Telerik.Windows.RadUploadHandler
{
public override Dictionary<string, object> GetAssociatedData()
{
Dictionary<string, object> dict = base.GetAssociatedData();
String buffer = this.Request.Form[Telerik.Windows.Controls.RadUploadConstants.ParamNameData];
dict.Add("imgLastChunkData", buffer);
return dict;
}
int i = 0;
public override void ProcessStream()
{
i = i + 1;
byte[] buffer = Convert.FromBase64String(Request.Form[RadUploadConstants.ParamNameData]);
this.AddReturnParam(RadUploadConstants.ParamNameAssociatedData, "");
this.AddReturnParam(RadUploadConstants.ParamNameFinalFileRequest, this.IsFinalFileRequest());
this.AddReturnParam(RadUploadConstants.ParamNameSuccess, true); // or false if something fails
this.AddReturnParam(RadUploadConstants.ParamNameMessage, "");// or add an error message if it is needed
string fileName = this.Request.Form[RadUploadConstants.ParamNameFileName];
string filePath = this.GetFilePath(fileName);
this.AddReturnParam(RadUploadConstants.ParamNameFileIdent, filePath);
this.AddReturnParam(RadUploadConstants.ParamNameFileName, fileName);
this.AddReturnParam(RadUploadConstants.ParamNameFilePath, filePath);
}
}
}