Is it necessary to keep track of the selectedFilesSize at all time. Isn't it better to make this part of the per-file contentObj and calculate the total once when upload is kicked off? This also avoids the need to recalculate the total when files are removed from the list, which is currently not done.