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

I don't think it has anything to do with c/c++ difference. 

Here is my point: use a function like `getBaseName` can clearly tell anyone reading the code what we are doing: get the file name part from a full path.