Our validation demo demonstrates an easy way of combining RadAsyncUpload client-side and server-side validation:
The area below the RadAsyncUpload lists all images passed the client-side validation successfully and shows an error message if current file fails.
The server-side validation is dividing all uploaded files in two separate lists -
one for the successfully saved images with total size less than 1 Mb and another one for the not saved images (due to exceeding that limit).
RadAsyncUpload can automatically validate files using the AllowedFilesExtensions
and the MaxFileSize properties. All files with invalid
extensions are rejected on the client, without wasting bandwidth to upload them
to the server.
RadAsyncUpload provides client-side event called OnClientValidationFailed.
It is fired when the selected file has invalid extension or its size exceeds the value set to
the MaxFileSize property.
The sever-side FileUploaded event is fired separately for each and every uploaded
file. Each file can be marked as a valid or invalid using the IsValid
property of FileUploadedEventArgs. Valid files are automatically
saved to the target folder.