asp.net - Validate file size using java script -
i trying validate file size, trying upload file upload control. validate size of file, using java script code. throwing run time error. please me.
<script language="javascript" type="text/javascript"> function getsize() { var myfso = new activexobject("scripting.filesystemobject"); var filepath = document.upload.file.value; var thefile = myfso.getfile(filepath); var size = thefile.size / (1024 * 1024); alert(size + "mb"); } </script>
error message : microsoft jscript runtime error: automation server can't create object
javascript has no access filesystem not possible check size of file javascript.
and
new activexobject("scripting.filesystemobject");
- supported ie check suing ie not other browser.
check : how validate upload file size , file extension using javascript ?
Comments
Post a Comment