Get size fo sum of file uploaded with blueimp

Get size fo sum of file uploaded with blueimp

HI sorry for english .

Im searching the way to found the sum of filesize uploaded with blueimp .

I try this :

  1. <script>
  2. var sizetotal=0;
  3. $('#fileupload').fileupload({    
  4.     complete: function (e, data) {
  5.       $.each(data.files, function (index, file) {
  6.             sizetotal=sizetotal + file.size;
  7.       });
  8.        
  9.       
  10.     }
  11. });
  12. console.log(sizetotal+'|');
  13. </script>
But in console i have :

jquery.js:358 Uncaught TypeError: Cannot read property 'length' of undefined(…)

The row  is this :

  1. each: function( obj, callback, args ) {
  2. var value,
  3. i = 0,
  4. length = obj.length,     // error in this point 
  5. isArray = isArraylike( obj );
Can u help me ? Tank's