:: Forum >> General/Off-topic >>

Validate file size and mime type at client side

Does anyone know how to do that?? i NEED to check size and type before upload a file to server, and i dont want to use ActiveX Objects.

Tnx for comments.
Nahomi
Sunday, March 6, 2005
Check this this may helps you

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>
Kiran
Saturday, June 3, 2006



This topic is archived.

Back to support forum

Forum search