ASP.NET Uploading files in the background (BITS/AJAX?)

1.7k views Asked by At

I have a webpage where users can create a database record and select a file they want to upload to the database server. these files can be big, like 100mb.

I dont want the user to wait, so I want the file to be uploaded in the background. So that they can continue with doing other stuff while the file is being uploaded.

Is BITS the way to go for this? Or is that only for Fatclient development? Any good tuterials ?

If BITS is not the way to go, what are my options? An ajax call to a services with the filelocation?

3

There are 3 answers

2
Asbjørn Ulsberg On BEST ANSWER

If you, by saying "they can continue with doing other stuff", mean that they can do other Ajax requests on the same web page (i.e. not navigating away from it), you can accomplish this with any Flash-based uploader (SWFUpload is one of many). This doesn't require anything but some JavaScript, an <input type="file"> and the embedded Flash uploader.

If you want the user to be able to navigate away from the page initiating the upload, you can't really do it within the browser, at least not until WebSockets are fully implemented in all browsers. Even then, it's going to be quite hard.

0
David Hoerster On

I don't think BITS will do the trick for you. I've never used it, but it doesn't seem that it can be accessible via a web application - it seems more suited for a windows client app or windows service.

You may want to consider either Andrew Valums AJAX Upload control (http://valums.com/ajax-upload/) or Uploadify (http://www.uploadify.com/). These are both jQuery AJAX controls (and uploadify requires Flash). I work with jQuery for web application development, so I'm partial to these controls. I've used Valums' upload control for several projects and it works very well. I haven't used uploadify in an actual production application because of the Flash requirement (but it looks very nice). I'm sure there are other AJAX upload tools for other JavaScript frameworks.

I hope this helps!

0
Ricketts On

I know this post is a bit old but I was having the same issue. My work around is to use a small pop-up window that only incorporates the file upload controls and parameters to determine where the documents should be stored. The user can upload the file from the small popup window and while it is uploading, continue to browse anywhere they wish on the original browser window because they will never actually leave. Just a thought for others in the same boat.