Resumable.js
http://www.resumablejs.com/
Citar
What is Resumable.js
It’s a javascript library providing multiple simultaneous, stable and resumable uploads via the HTML5 File API.
The library is designed to introduce fault-tolerance into the upload of large files through HTTP. This is done by splitting each files into small chunks; whenever the upload of a chunk fails, uploading is retried until the procedure completes. This allows uploads to automatically resume uploading after a network connection is lost either locally or to the server. Additionally, it allows for users to pause, resume and even recover uploads without losing state.
It’s a javascript library providing multiple simultaneous, stable and resumable uploads via the HTML5 File API.
The library is designed to introduce fault-tolerance into the upload of large files through HTTP. This is done by splitting each files into small chunks; whenever the upload of a chunk fails, uploading is retried until the procedure completes. This allows uploads to automatically resume uploading after a network connection is lost either locally or to the server. Additionally, it allows for users to pause, resume and even recover uploads without losing state.
Lo he usado para subir archivos de hasta 10 GB.
Si lo que realmente quieres es aprender a utilizar el input file del HTML te puede devoler un arreglo "files" con el cada uno de los items puedes obtener el size individual: File.size
https://developer.mozilla.org/en-US/docs/Web/API/File
Si te refieres a la data de que mandas mediante POST, lo ideal seria obtener el length de todos los campos URLencodedeados + los nombres de las variables y con eso se das mas o menos cuanto va a ser el Content-Length final, generalmente se mandan:
Código:
Variable1=DATA+URL+Encode&Variable2=DATA+URL+Encode&Variable3=DATA+URL+Encode
Y asi sucesivamente, a no se que lo estes mandando en JSON o XML o algun otro formato
Saludos!