Edit this page


Basic Client Side Validation

RadCloudUpload offers an easy way to validate the size and the file type of the uploaded file. To enable it just set MaxFileSize and AllowedFileExtensions. If selected file doesn't pass any of them then OnClientValidationFailed will be fired.#ASPX

<telerik:RadCloudUpload ID="RadCloudUpload2" runat="server" ProviderType="Everlive" OnClientValidationFailed="OnClientValidationFailed" AllowedFileExtensions=".png,.jpg" MaxFileSize="500 kB">
function OnClientValidationFailed(sender, args) {
  var errorMessage = args.get_message();
  var fileName = args.get_filename();
  alert(fileName + ' failed to upload. ' + errorMessage);

Validate the Maximum Number of Uploaded Files

<telerik:RadCloudUpload ID="RadCloudUpload2" runat="server" ProviderType="Everlive"
MultipleFileSelection="Automatic" OnClientFileUploading="OnClientFileUploading">
function OnClientFileUploading(sender, args) {
  var filesCount = sender.get_uploadedFiles().length,
  maxFilesCount = 3;

  if (filesCount > maxFilesCount) {
    alert('You cannot select more than: ' + maxFilesCount);
Is this article helpful? No Yes
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article