A little less than a year ago I wrote about an AsyncFileUpload component for Silverlight/ASP.NET. Several things have happened since then, so I decided to rewrite it and address some of the limitations it had along the way. To make sure we’re on the same page, let me outline the goals of this proof-of-concept:
- Demonstrate how OpenFileDialog and HttpWebRequest can be used to upload (large) files.
- Show how isolated storage can be used to enable file resumes (even across browsers on the same machine).
- Share some experimental object model to simplify ASP.NET/Silverlight component development.
The only real non-goal is building a file upload component of production-quality.
The result
There are a few different demos you can take a look at:
- AsyncFileUpload with the default template (pure HTML visualization);
- AsyncFileUpload with a custom template (includes two Silverlight visualizers);
- AsyncFileUpload used from JavaScript. Although this demo still uses ASP.NET, you could easily do the same thing from other languages/frameworks/web-servers as well.
You can also download the source code for the actual library behind all of this.