I need to prevent user from uploading large image to server and wanted to use the simple input type="file". Using the jQuery below, how do I reset the "input file" when this.files exceed 1048000?
$('.image-file').bind('change', function() {
if ( this.files[0].size > 1048000 ) {
alert('Image size can not more than 1Mb.');
// going to reset the file
}
});
<input type="file" name="photo[]" class="image-file">
<input type="file" name="photo[]" class="image-file">
<input type="file" name="photo[]" class="image-file">