javascript - MVC FileUpload file size client side validation -


how can validate file size client side. can controlled via controller like,

if (file.contentlength > 1048600) { } on client side can control name , extension of file. how control size?

<input type="file" name="file" id="file" />

thanks

i dont think there cross browser way want, check question

this can work in webkit based browsers example

var size = document.getelementbyid('file').files[0].size; 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -