There is no JavaScript solution for this choice of browsers. There is a File API , but as long as it works in new versions of Firefox and Chrome, this will not happen in IE (there are no signs of this in IE9 either).
In any case, reading the file locally and downloading it via XMLHttpRequest is inefficient, because XMLHttpRequest is not able to send pure binary, only Unicode text. You can encode the binary into text using base-64 (or, if you are really allocated, a custom 7-bit encoding), but it will be less efficient than regular file loading.
You can upload files using Flash (see SWFUpload et al.) Or even Java if you should ( Jumploader ... These days, I wouldn’t worry, since the prevalence of Flash is very high and the Java plugin continues to decline). You don't necessarily get low-level controls to split into pieces, but do you really need it? What for?
Another possible approach is to use a standard field for loading HTML files, and when sending, set an interval call to poll the server with XMLHttpRequest, asking him how far the file download is going. This requires a little work on the server to save the current load in a session or database so that another request can read it. It also means using a form parsing library that gives you a progress callback that most standard built-in languages like PHP don't work.
No matter what you do, use the “progressive boost” approach, allowing browsers to return to simple HTML loading without support. Browsers usually have a download progress bar to download HTML files, it tends to be small and easily overlooked.
bobince
source share