Quote:You actually don't have access to filesystem (for example reading and writing local files), however, due to HTML5 File Api specification, there are some file properties that you do have access to, and the file size is one of them. For the HTML bellow HTML <input type="file" id="myFile" /> try the following: JavaScript //binds to onchange event of your input field $('#myFile').bind('change', function() { //this.files[0].size gets the size of your file. alert(this.files[0].size); }); As it is a part of the HTML5 specification, it will only work for modern browsers (v10 required for IE) and I added here more details and links about other file information you should know: http://i.ndigo.com.br/2012/01/javascipt-checking-the-file-size/
<input type="file" id="myFile" />
//binds to onchange event of your input field $('#myFile').bind('change', function() { //this.files[0].size gets the size of your file. alert(this.files[0].size); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)