Skip to content

Instantly share code, notes, and snippets.

@fedir
Created February 6, 2014 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedir/8840913 to your computer and use it in GitHub Desktop.
Save fedir/8840913 to your computer and use it in GitHub Desktop.
Get total file size before upload with HTML5 File API and jQuery
var totalSize = 0;
$("input:file").each(function(){
if($(this)[0].files[0]) {
totalSize = totalSize + $(this)[0].files[0].size;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment