// fileName :前台传入的文件名(主要是标识文件是什么格式.png或.zip)
// cosKey:上传文件时腾讯云返回的标识
// 配置腾讯云基本信息
String aliyunId = ApplicationPropertyUtils.getContextProperty("TENXUN_ACCESS_KEY_ID");
String aliyunSecret = ApplicationPropertyUtils.getContextProperty("TENXUN_ACCESS_KEY_SECRET");
String ossEndpoint = ApplicationPropertyUtils.getContextProperty("TENXUN_OSS_ENDPOINT");
COSClient cosClient = new COSClient(cosEndpoint, tenxunId, tenxunSecret);
// 从腾讯云下载文件
GetObjectRequest getObjectRequest = new GetObjectRequest(bucketName,cosKey)
java后台简单从腾讯云下载文件通知前端以附件的形式保存
最新推荐文章于 2024-02-29 20:13:53 发布