The files being uploaded are being emailed to the submitter in response to their request for public records. I would like to be able to determine the total size of the file(s) that are to be sent. Our email server will only accept X amount to be sent. I would like the process diagram to be able to decide if the reply should be emailed or it needs a different option.
I was looking at something like:
var totalSize = 0;
$("#q5 input").on('change', function() {
$("#q5 input").each(function() {
for (var i = 0; i < this.files.length; i++) {
totalSize += this.files[i].size;
}
alert("Total Size: " + totalSize);
});
});
Which does add up the total file size but does not iterate over each file, this.file.length is always 1. And it does not trigger when a file is deleted.