源码:
try:
with open(apk_name, 'rb') as f:
file = leancloud.File(apk_name, f)
file.save()
f.close()
return file._url
except Exception as e:
print('Upload apk error:' + str(e))
sys.exit()
报错信息:
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): app-router.leancloud.cn
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cvkrebrv.api.lncld.net
DEBUG:urllib3.connectionpool:https://cvkrebrv.api.lncld.net:443 "POST /1.1/fileTokens HTTP/1.1" 201 None
Upload apk error:Can't convert 'bytes' object to str implicitly
DEBUG:urllib3.connectionpool:https://app-router.leancloud.cn:443 "GET /2/route?appId=cvKrEbRV55FItUPuHiGlotiv-gzGzoHsz HTTP/1.1" 200 261
我在这里是想用脚本上传更新使用的apk包,另外,这种情境下,需要设置绑定的api域名吗? 没有找到相关文档,因为没有用lean init
初始化过,并不是云引擎项目