Tuesday, January 4, 2011

Get File size in javascript

function A()
 {
 var oas = new ActiveXObject("Scripting.FileSystemObject");
 var d = document.a.b.value;
 var e = oas.getFile(d);
 var f = e.size;
 alert(f + " bytes");
 }
  
 
 <form name="a" >
  <input type="file" name="b" >
  <input type="button" name="c" value="SIZE" onClick="A();" >
  </form >
  </body >

Share This!


No comments:

Powered By Blogger · Designed By Seo Blogger Templates