How to fix WordPress upload error unexpected response from the server

You might experience the following upload error in WordPress: Unexpected response from the server. The file may have been uploaded successfully.