def UploadFile(self, appId, upfile):
        filepath = os.path.normpath(upfile).replace("\\", "/")
        print("UploadFile filepath=" + filepath)

        suffix = FileUtil.GetFileExt(filepath)
        strurl = self.GetUploadUrl(appId, suffix)
        jsonRoot = json.loads(strurl)
        uploadUrl = jsonRoot["uploadUrl"]
        authCode = jsonRoot["authCode"]
        files = {'file': open(filepath, 'rb')}
        params = {
            'authCode': authCode,
            # 'file':files,
            'fileCount': 1
        }
        fileName = FileUtil.GetPathNameWithExt(filepath)
        m = MultipartEncoder(
            fields={
                'authCode': authCode,
                'fileCount': '1',
                'parseType': '1',
                'file': (fileName, open(filepath, 'rb'), 'multipart/form-data')
                # 'file': open(filepath, 'rb')
            })
        print("m.content_type=" + m.content_type)
        header = {
            'Content-Type': m.content_type,
            # 'Content-Type':  'multipart/form-data',
            # 'accept':'application/json',
            'client_id': self.ClientId,
            'Authorization': 'Bearer %s' % self.GetToken()
        }

        mdl_rqt = requests.post(
            uploadUrl,
            # json=paramges,
            data=m,
            # files=files,
            headers=header)
        strret = mdl_rqt.content.decode("utf-8")
        print(strret)

        jsonRoot = json.loads(strret)
        UploadFileRsp = jsonRoot["result"]["UploadFileRsp"]
        fileDestUrl = UploadFileRsp["fileInfoList"][0]["fileDestUlr"]
        print("fileDestUrl=" + fileDestUrl)
        return UploadFileRsp["fileInfoList"][0]
    def CommitApk(self, appId, jsondata, filepath):
        fileDestUrl = jsondata['fileDestUlr']
        url = "https://connect-api.cloud.huawei.com/api/publish/v2/app-file-info?appId=" + appId
        fileName = FileUtil.GetPathNameWithExt(filepath)

        print(" fileName =", fileName)
        params = {
            'fileType':
            '5',
            'files': [{
                # 'size':'79518677',
                'fileName': fileName,
                'fileDestUrl': fileDestUrl
            }]
        }
        mdl_rqt = requests.put(url, json=params, headers=self.GetUrlHead())
        strret = mdl_rqt.content.decode("utf-8")
        print(strret)
        return strret