implement uploading in the client