A bug! When iterating the file list to upload, we are also deleting
files as they are uploaded. Need to store a const copy of this list
before iteration begins.