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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -