javascript - Unable to call getFile() from ActiveXObject -
hi created file upload kind of thing, in provide upload file size validation wrote following code worked fine in chrome , firefox.
$('#file').change(function() { filesizeerror = (this.files[0].size/(1024*1024) > 1) ? true:false; });
but code not working in ie, implement same in following fashion
var myfso = new activexobject("scripting.filesystemobject"); var filepath = $('#file')[0].value; var thefile = myfso.getfile(filepath); alert('rajaram'); var size = thefile.size; alert(size + " bytes");
here myproblem myfso.getfile() notworking .the alert not prompted
here problem myfso.getfile() not working
thank heaven that! otherwise, browsing websites ie in lot of trouble quickly, malicious sites access files.
access local file system through wide-open api filesystemobject
not allowed internet zone content. (the way use unsafe scripting activex control in ie put page in trusted security zone , lower zone's security slider low.)
the html5 file api dramatically more locked-down, giving javascript restricted access limited set of files user has selected.
Comments
Post a Comment