So I've got an HTML form with an upload.
<input type="file" name="uploaded_file" id="uploaded_file">
Using jQuery I am doing a client side size check of the file.
jQuery('#uploaded_file').bind('change', function() {
var size = this.files[0].size/1024/1024;
if (size > 3.00){
jQuery("#upload_msg").html('File size is ' + size.toFixed(2) + ' / 3.00 MB.');
}
if (size <= 3.00){
jQuery("#upload_msg").html('File size is ' + size.toFixed(2) + ' / 3.00 MB.');
}});
I want to set a condition so that if a user chooses a file, then changes their mind and unchooses a file to upload that the jQuery adjust back to it's original form.
How do I set a condition for that? Thank you!