Connect to the server.
Get the file to the local machine.
After getting the file to the local machine, delete the file in the server.
Do what ever you want to update in the file, which is now in the local machine
Put the updated file on the server.
This is just a suggesstion or point from my side!!!