Jump to content

How to get file size by ajax


phparmy

Recommended Posts

Try javascript to get file size

 

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");

}

 

</script>

</head>

<body>

<form name="a">

<input type="file" name="b">

<input type="button" name="c" value="SIZE" onClick="A();">

</form>

</body>

</html>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.