Reordered hide button and upload operations for improved safety

First hide the upload button, then start the actual upload, then show the stopping button.