implement update_action and change the context menu's upload to update

Sorry but you don't get my point. The code in the PR implements the required functionality, but not in a clear way. It can be and should be improved to make the code more readable.