Telerik AsyncUpload: InvalidFiles-property
I’ve upgraded the Telerik ASP.NET AJAX-controls to the latest version this week (2010.3.1109) and experienced some problems with the AsyncUpload-control.
I always check the release notes of the newly released versions but nothing indicated breaking changes:
- Added: Silverlight Module
- Added: Inline Progress indicator
What’s Fixed
- Fixed: RadAsyncUpload now works with Forms/Windows authentication and Anonymous Authentication disabled as long as there is Silvelright installed on the client’s browser
- Fixed: RadAsyncUpload manual server-side validation not working
However when compiling our project I got the error that the property InvalidFiles didn’t exist for the AsyncUpload-control. I used this property to check if any file was selected with the wrong extension and show the appropiate error message.
I’ve contacted the Telerik support for this with the following answer:
With RadAsyncUpload we wanted to undertake a different approach in handling files. In RadAsyncUpload the FileUploaded event is fired for each and every uploaded file and the event argument object of that event contains IsValid property, which specifies whether the uploaded file is valid or not. You can use that event in order to perform actions regarding invalid files. Despite that, I believe that it might be a good idea to bring back the InvalidFiles collection, or at least a property to RadAsyncUpload specifying whether there are invalid files or not.
So they will include the property again in one of the following releases. When trying to implement a fix I noticed that the browse control is now filtering automatically on the allowed extensions set on the AsyncUpload-control.
A nice upgrade! No need to validate this myself anymore!
At first I was a little bit frustrated about the breaking change (without mentioning it in the release notes) but the new implementation is actually much better!
Thank you Telerik!