1

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?

lsalamon
  • 7,998
  • 6
  • 50
  • 63
Ivo
  • 3,406
  • 4
  • 33
  • 56
  • Seems like ajax does not allowed files posted, think the only upload will be to let the user wait (with some progress bar) till the upload is done. – Ivo Aug 24 '10 at 13:00
  • You can have the upload happen while the user is on the page, but the user can do other tasks while they're waiting. That's where the ajax upload components come in. The Valums control that I mentioned creates a hidden iframe on the page, and so the upload happens there. There user is able to do other actions on the page (think GMail). – David Hoerster Aug 24 '10 at 13:33

3 Answers3

1

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.

Asbjørn Ulsberg
  • 8,721
  • 3
  • 45
  • 61
  • With "Do other stuff" I mean browse away indead – Ivo Aug 24 '10 at 10:46
  • So you want the user to be able to start an upload on your web page and then punch in www.cnn.com into the address bar and expect the upload to continue? Whether the user navigates from the upload page to another page on your web site or cnn.com is irrelevant; navigating away from the upload page is what matters and what will stop the Flash uploader from finishing. – Asbjørn Ulsberg Aug 25 '10 at 09:42
0

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!

David Hoerster
  • 28,421
  • 8
  • 67
  • 102
0

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.

Ricketts
  • 5,025
  • 4
  • 35
  • 48