RadAsyncUpload introduced in Q1 2010 (version 2010.1.309) offers asynchronous upload capability while maintaining the look of the regular RadUpload control. The upload process requires that the files are uploaded to a custom handler and not to the hosting page.
The Async Upload is part of Telerik UI for ASP.NET AJAX, a
professional grade UI library with 100+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.
The Async Upload is part of Telerik UI for ASP.NET AJAX, a professional grade UI library with 100+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.
Files are stored in a temporary location until a postback occurs. Temporary files are also deleted after a set amount of time defined by the TemporaryFileExpiration property. (Default value: 4 hours)
The control supports web farm scenarios. Upload progress is available in this scenario as long as Flash or Silverlight is installed on the client machine.
To test it on your own and see its benefits in practice you can start a free trial using the button below
- ensure you have a script manager on the page (use <asp:ScriptManager> tag to declare one)
- use the <telerik:RadAsyncUpload> tag to declare the upload and specify the file upload folder by setting the TargetFolder property.
<telerik:RadAsyncUpload RenderMode="Lightweight" ID="RadAsyncUpload1" TargetFolder="Uploads" AllowedFileExtensions=".jpeg,.jpg,.png,.doc,.docx,.xls,.xlsx" runat="server"></telerik:RadAsyncUpload>
For more information on setting up the environment see the First Steps article.
RadAsyncUpload relies on saving temporary files to work. When posted, files are saved to the designated temp folder (App_Data/RadUploadTemp by default) with unique names. Once a postback occurs the RadAsyncUpload fires the OnFileUploaded event for each file. The target file is passed as part of the arguments to the event and can be set as either valid (default) or invalid. After the events fire, all files marked as valid are automatically saved to the TargetFolder if it’s set.
Finally, all processed temporary files are deleted. Temporary files are also deleted after a set amount of time defined by the TemporaryFileExpiration property.
With the release of Q1 2011 SP2 RadAsyncUpload supports setting the temporary folder globally in the appSettings section of the web.config. < add key="Telerik.AsyncUpload.TemporaryFolder" value="[path_to_the_temporary_folder]" /> The path can be relative or absolute.
Validation for RadAsyncUpload differs from validation in RadUpload as it is now possible to validate size on the client, as long as the File API upload module is used or there is Silverlight or Flash installed on the client's browser. If the validation fails, RadAsyncUpload will fire OnClientValidationFailed.
Internally, RadAsyncUpload can choose between four modules for uploading - File API, IFrame, Flash and Silverlight. The module with the highest priority and most features supported is File API. The Silverlight and Flash modules are a fallback if File API is not supported and any of the two technologies are available. The final fallback is an upload using the IFrame module supported in all browsers.
In web farms, each server will need to use the same MachineKey that RadAsyncUpload uses for encryption. Most web farms should already have their MachineKeys synchronized as this is the recommended approach for web farm deployment.
One of the benefits of RadAsyncUpload is that it allows you to upload files bigger than 2GB as explained at Uploading Large Files.