Is there any way to find out the file size before uploading the file using AJAX / PHP in change event of input file?
For the HTML bellow
<input type="file" id="myFile" />
try the following:
//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); });
See following thread:
How to check file input size with jQuery?
1.4m articles
1.4m replys
5 comments
57.0k users