New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

OnFileUploaded

The server-side OnFileUploaded occurs after a file is uploaded and a postback is triggered.

The handler of the OnFileUploaded event receives two arguments:

  • The RadCloudUpload control that initiated the file upload. This argument is of type object, but can be cast to the RadCloudUpload type.

  • An CloudFileUploadedEventArgs object. It has three properties:

    • IsValid - Allows you to specify whether the uploaded file is valid. The default value is "True" and in case that is preset to False, the callback mechanism will delete it from the Cloud Storage.

    • FileInfo - Returns fileInfo object containing information regarding the uploaded file.

The example below demonstrates how to access information about the uploaded file and to manage its IsValid State:

C#
protected void RadCloudUpload1_FileUploaded(object sender, CloudFileUploadedEventArgs args)
{
	//You could access the information about the uploaded file, using the FileInfo object. 

	long contentLenght = args.FileInfo.ContentLength;
	string contentType = args.FileInfo.ContentType;
	string keyName = args.FileInfo.KeyName;
	string originalName = args.FileInfo.OriginalFileName;

	//You could manage the IsValid state of the uploaded file.
	args.IsValid = true;
}
Not finding the help you need?
Contact Support