I can't get size

I want to use code from this page
docs.dhtmlx.com/doku.php?id=dhtm … htmlxvault

I’m interested in exactly this code

<div id="vaultDiv"></div> 
<script>  
   vault=new dhtmlXVaultObject(); 
   vault.setImagePath("codebase/imgs/"); 
   vault.setServerHandlers("UploadHandler.php", "GetInfoHandler.php", "GetIdHandler.php"); 
   vault.onUploadComplete = function(files) { 
      var s=""; 
      for (var i=0; i<files.length; i++) { 
         var file = files[i]; 
         s += ("id:" + file.id + ",name:" + file.name + ",uploaded:" + file.uploaded + ",error:" + file.error)+"\n"; 
      } 
      alert(s); 
   }; 
   vault.create("vaultDiv");
</script>

One change, which wants to add it is

<div id="vaultDiv"></div> 
<script>  
   vault=new dhtmlXVaultObject(); 
   vault.setImagePath("codebase/imgs/"); 
   vault.setServerHandlers("UploadHandler.php", "GetInfoHandler.php", "GetIdHandler.php"); 
   vault.onUploadComplete = function(files) { 
      var s=""; 
      for (var i=0; i<files.length; i++) { 
         var file = files[i]; 
         s += ("id:" + file.id + ",size:" + file.size + ",name:" + file.name + ",uploaded:" + file.uploaded + ",error:" + file.error)+"\n"; 
      } 
      alert(s); 
   }; 
   vault.create("vaultDiv");
</script>

And i allways get “size:undefined”
Thanks for help

There is no file size information on the client side.

So how can I get the size of the file to be added?

You need to pass this information form the server. So you need to change server side scripts.

I do not understand something. Here, for example, I get the file size.

<!doctype html>  
<html>  
<head>  
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />  
<title>File(s) size</title>  
<script type="text/javascript">  
function updateSize() {  
 var nBytes = 0, oFiles = document.getElementById("uploadInput").files, nFiles = oFiles.length;  
 for (var nFileId = 0; nFileId < nFiles; nFileId++) {  
  nBytes += oFiles[nFileId].size;  
 }  
 var sOutput = nBytes + " bytes";  
 // optional code for multiples approximation  
 for (var aMultiples = ["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"], nMultiple = 0, nApprox = nBytes / 1024; nApprox > 1; nApprox /= 1024, nMultiple++) {  
  sOutput = nApprox.toFixed(3) + " " + aMultiples[nMultiple] + " (" + nBytes + " bytes)";  
 }  
 // end of optional code  
// alert(nBytes);
 document.getElementById("fileNum").innerHTML = nFiles;  
 document.getElementById("fileSize").innerHTML = sOutput;  
}  


</script>  
</head>  
  
<body onload="updateSize();">  
<form name="uploadForm">  
<p><input id="uploadInput" type="file" name="myFiles" onchange="updateSize();" multiple="multiple" /> selected files: <span id="fileNum">0</span>; total size: <span id="fileSize">0</span></p>  
<p><input type="submit" value="Send file" /></p>  
</form>  
</body>  
</html>  

I do not understand how once javascript can show such a result and not the second time?

That’s true, it works in some browsers, but does not work in IE. Should we add this function in the next release.

Yes, but I do not want to use IE and Mozilla only and exclusively. I do not understand why the same functionality js works, and using dhtmlx not?

This is because in the event handler we expose our own file object.
Good that you can stay without IE, not everyone agrees on that.
As i said, we will add size property to the next release.