Download large files using pure HTML and MVC 3

I have an application that allows users to upload files. Some of these files can be quite large. Because of this, I want to split the file (if possible) and control its download. Currently, I have a basic HTML form that submits back to my MVC controller.

[AcceptVerbs(HttpVerbs.Post)] public ActionResult UploadFile(IEnumerable<HttpPostedFileBase> files) { // Save file here. HttpStatusCodeResult result = new HttpStatusCodeResult(200); return result; } 

This approach allows me to upload a file. However, this application is one single task. I need to be able to run the download and track its progress. Uploadify will not work in my case because it uses Flash. I have a strict No-Flash requirement.

I am open to a hybrid approach, where if the user's browser supports HTML 5, I would use the File API, otherwise I would use my current approach. However, even with HTML 5, I'm not sure how to start the download and keep track of its progress.

Can someone help me?

Thanks!

+4
source share
2 answers

You can take a look at Valums AJAX upload . Personally, I have used it many times and am very pleased with it.

Functions

  • multiple file selection, progress bar in FF, Chrome, Safari
  • drag and drop file in ff chrome
  • Download canceled.
  • no external dependencies
  • does not use flash
  • fully works with https
  • keyboard support in FF, Chrome, Safari
  • tested in IE7.8; Firefox 3,3,6,4; Safari4.5; Chromium; Opera10.60;
0
source

I had a good experience with Plupload . It works great with jQuery user interface.

Below are some backlit features:

  • Chunking
  • Drag and drop
  • PNG resizing
  • Resize JPEG
  • Type filtering
  • Stream loading
  • Multipage Download
  • File size limit
  • Download Progress
  • Custom headers

It supports the following plugins / technologies for almost full use of the cross browser (with varying degrees of support for functions):

  • Flash
  • Gears
  • HTML 5
  • Silverlight
  • Browserplus
  • HTML 4
+2
source

Source: https://habr.com/ru/post/1390651/


All Articles