The Case of Telerik’s New Old ASP.NET AJAX Upload Control – RadAsyncUpload

by ASP.NET AJAX Team | Comments 11

y-u-no-use-async-uploadIt’s weird that RadAsyncUpload, Telerik’s next-generation ASP.NET upload control, was introduced more than 2 years ago and while its functionality is times richer than the one of RadUpload, the latter is still one of our most widely used controls and the former simply stays in the shadow. People continue recommending our older Upload control in community forums, our customers continue to use it in new projects and we just don’t get it.

This blog post is aimed at explaining why Telerik’s Async Upload is better for new project development and what you will win by migrating RadUpload to it. We will also point you to some useful resources to help you migrate painlessly. 

NOTE 1: I’d like to say something important, so stay with me. Starting tomorrow, all RadUpload demos will be marked as Obsolete and that’s not because we have stopped supporting the control, but because we are trying to show our new customers that it’s not the best thing we have to offer to satisfy their needs. 

NOTE 2: We are indeed planning on discontinuing the support for RadUpload in June 2013 (Q2’13), although it will still be available in the suite. We are positive that RadAsyncUpload can better serve your upload needs and we kindly ask you to transition to it to make sure you take advantage of its support and the new features we constantly add to it.

So…Why Should You Use RadAsyncUpload?

RadAsyncUpload has a ton of functionality on top of RadUpload. Here’s what you win by using the new control, as well as links to demos showing how you can implement this functionality in your scenarios: 

1) In the first place, our AsyncFileUpload control supports file uploads using AJAX. The biggest limitation of our old upload is that it requires full page postback to send the files to the server. Well, no longer! With RadAsyncUpload, the files are uploaded in a fully asynchronous manner to the server, which leads to a smoother experience for your application. The good part is that the AJAX functionality is integrated into the upload so that you don’t have to write a single line of code. 

2) Our new ASP.NET upload supports “real” multiple file selection. What does this mean? Well, it means that users will be able to select a couple of files from the same file dialog and send them to the server with a single action. 

3) There is a client-side validation by size! This is one of the major weaknesses of the old upload and it turned out to be a real show stopper for some of our customers. With the Async Upload you can validate the size on the client and avoid round-tripping to the server in case of invalid file. 

4) RadAsyncUpload supports drag-and-drop file uploads in all HTML5-compliant browsers (FireFox, Chrome, Safari and IE10). 

5) Telerik’s Async Upload can persist uploaded files across postbacks until a specific button is pressed. This was a common request and is a huge benefit compared to the classic RadUpload, which will upload the select files to the server no matter what action triggered the postback. 

Here’s How to Painlessly Migrate to the New (Old) Control

We did everything possible to make your transition from RadUpload to RadAsyncUpload effortless. The look of the two controls is identical and there are just a few differences in the setup. The upload process with the Async Upload control requires that the files are uploaded to a custom handler and not to the hosting page. In addition, the files are stored in a temporary location until a postback occurs, after which the location cleans automatically. 

Practically, the transition is as easy as 1-2-3:

1) Since RadAsyncUpload uses an HTTP handler to manage file uploads, make sure that you have registered the handler's URL in the web.config using the control’s Smart Tag. 

2) Replace the old declaration
<telerik:RadUpload …></telerik:RadUpload>
with the new one:
<telerik:RadAsyncUpload …></telerik:RadAsyncUpload>

3) You can leave all old properties intact because we have made them identical for both controls. 

4) [Optional] Set the MultipleSelection property to Automatic. This will enable multiple file selection on all common browsers.

5) [Optional] Set the TemporaryFolder property. In the common case it can be any folder with a couple exceptions:
a. In Medium Trust this must be a folder that is inside your application folder.
b. In a Web farm environment, the TemporaryFolder as well as the TargetFolder properties must be set to folders located in share drive

You can find more detailed information in RadAsyncUpload’s online documentation

In the Hands of the Decision-Maker

So next time you need an advanced ASP.NET upload control, at least give RadAsyncUpload a chance, please. It allows your users to do the stuff they are so used to – selecting multiple files, uploading files with drag and drop, working on other things, while the files are uploading. The migration to the control is a breeze, so the sooner you do it, the better. If for some reason RadUpload is better-suited for your custom scenarios (and you’ll really surprise us with this one), please share with us how we can make RadAsycnUpload better. As usual, your opinion and sincere feedback are what Telerik’s ASP.NET AJAX team counts on! 

We really believe we can make your life easier with RadAsyncUpload, so y u no use it? :-)

About the author

Genady Sergeev

Genady Sergeev

is the team lead of one of Telerik's ASP.NET AJAX teams, where he is mainly responsible for RadAsyncUpload, RadListBox and RadScheduler. He joined the company back in 2009 and ever since he has been working in the continuously-changing field of client-side development. Genady's main interests are dynamic programming languages and TDD and when it comes to his free time, he is keen on extreme sports.

Posted in: upload aspnet-ajax

11 Comments

Nico
Hello,

tl;dr to be honest (not all of it at least), at work..
I'll just answer your question "so y u no use it? :-)"

Have to say I even use the standard asp upload most of the time.
The MAIN reason is that the radupload out of the box is too confusing for users;
take this one:
http://demos.telerik.com/aspnet-ajax/upload/examples/overview/defaultcs.aspx
Most users will click "Add" a few times, before maybe understanding it.
I often use an iframe with just the standard asp upload inside which does about the same thing, but without ANY special configuration, the standard look each browser gives this "special" control, as to not confuse users. Having it in an iframe also enables me to use it without having to even think about ajax. Been doing this in radgrids, and a bit everywhere, for years. Each time, a small improvement is added... Copy paste coding them: superfast, nothing to configure, no brain activity required.

In short: radupload doesn't have the browser standard look I want it to have, requires configuration, and simplicity of reusing code that works regardless of telerik versions, ajax settings, etc..
Janos Corseny
recenty i saw the async upload, and terrible for me 'cuz i will need to migrate
Jeff Fritz
Nico,

Neat approach with an iframe referencing the same page that has a standard asp upload control on it.  Have you considered wrapping your iframe based approach in a user control, so that you can simply add the user control to any webform that you need upload capabilities on?  In this way, you can configure your iframe in one place, inside of your "FileUploadUserControl".

While you have the input wrapped in a user control, you COULD switch out the iframe to a design with async capabilities.  In this way, you have abstracted the upload control from the implementation in the rest of your application.  In fact, this structure is very similar to how the RadAsyncUpload handles older browsers - and I believe is the reason for this blog post. 

I can see your point about the "Add" button confusing users.  Perhaps an alternative with this control would be to use the localization features to change the text of the Add button to "Add Another File" or similar text.  This button is not present in the AsyncUpload control described in the article, but is in the control that Telerik intends to deprecate.

Finally, I like your technique to add small improvements each time you iterate on your iframe-based solution.  What kinds of features have you found it valuable to add?  Have you tried an asynchronous based solution, and have you had any problems that you can share?  

File-uploads are a messy problem that I always end up tripping myself up on, and would like to hear more from a developer like yourself who has been managing this problem for some time.
Iva
Great work!
Ben Hayat
"NOTE 1: I’d like to say something important, so stay
with me. Starting tomorrow, all RadUpload demos will be marked as
Obsolete and that’s not because we have stopped supporting the control,
but because we are trying to show our new customers that it’s not the
best thing we have to offer to satisfy their needs. "


Great decision!
Stuart Hemming
I must be an abnormality; I switched to the newer control almost as soon as it became available and I've never looked back!
jason
multiple selection still doesn't work with safari. disappointed!
Peter Filipov
Hello,
The issue is related with Safari 5. The browser does not implement FileAPI correctly. We reported the bug and now in Safari 6 the problem is resolved.

Regards,
Peter
J.C.A. Kokenberg
We've been using the RadAsyncUpload control for quite a while now. I do agree with Nico about the 'add' button, however, we wrapped the AsyncUpload control within our own Upload User Control so that we have a little more control and were able to hide the add button. Now, when a file (or files) are selected, they are uploaded at once. No need to click on the 'add' button.

I really like the AsyncUpload. As stated, it provides a more smooth user experience and it offers me, as a developer, a lot of possibilities on how to handle the files, both on the client and on the server side.

One little point though, would be the loading time. We use the Silverlight upload variant by default, and it's not the fastest loading control... So it happens that our page has loaded and after 2 or 3 seconds, poof, the upload control appears. It would be nice to see a loading image, or something there so that our users know that there is somehting there, but that it is still loading.

My guess would be that this is more Silverlight related than anything else but still...
atsushi
Two links in this page are broken, and I cannot see important information:

http://local.telerik.com/help/aspnet-ajax/asyncupload-getting-started.html
http://local.telerik.com/help/aspnet-ajax/asyncupload-overview.html

Can I see the information somewhere else?

Atsushi
Paulina Tsolova
Hi Atsushi,

Thank you for reporting this. The links have now been updated.

I apologize for any inconvenience caused.

Comments

  1.    
      
      
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)
Read more articles by ASP.NET AJAX Team - or - read latest articles in Developer Tools