re-read and added comments where needed for do-upload.php
https://app.asana.com/0/19128794071859/20811486365150