HTML:
<input type="file" name="photo" id="photo" />
Java Script:
$('#photo').live('change', function(){
var file_size=this.files[0].size;
alert(file_size);
});
Notes:
1. This is a HTML5 feature. So I think its only works on HTML5 supported browsers.
2. Similarly we can get some attribute of file.
Source:
http://stackoverflow.com/questions/8192516/html5-file-browse-tag
http://forum.jquery.com/topic/how-to-validate-file-size-function-before-submitting-form
<input type="file" name="photo" id="photo" />
Java Script:
$('#photo').live('change', function(){
var file_size=this.files[0].size;
alert(file_size);
});
Notes:
1. This is a HTML5 feature. So I think its only works on HTML5 supported browsers.
2. Similarly we can get some attribute of file.
Source:
http://stackoverflow.com/questions/8192516/html5-file-browse-tag
http://forum.jquery.com/topic/how-to-validate-file-size-function-before-submitting-form
No comments:
Post a Comment