当前位置:网站首页>获取七牛云地址文件保存到本地
获取七牛云地址文件保存到本地
2022-07-29 21:13:00 【~忆缘】
qiniuImagePath:图片所在的七牛地址路径
public Map<String, String> waterImage(String qiniuImagePath, String address) {
String fileid = "";
try {
String projectPath = (String) MAppContext.getGlobalVariable(MAppContext.GLOBAL_VARIABLE_PROJECTPATH);
String finalImageWater = projectPath + "/WEB-INF/template/waterImageFinal.jpg";
URL url = new URL(qiniuImagePath);
File dirfile = new File(projectPath);
if (!dirfile.exists()) {
dirfile.mkdirs();
}
FileUtils.copyURLToFile(url, new File(projectPath + "/WEB-INF/template/image.jpg"));
//要上传到七牛的文件名字
fileid = 111;
//上传到七牛
QiniuFileUtil.upload(new File(finalImageWater), fileid);
} catch (Exception e) {
e.printStackTrace();
}
Map<String, String> result = new HashMap<>();
result.put("field", fileid);
return result;
}
边栏推荐
- 1. Promise usage in JS, 2. The concept and usage of closures, 3. The difference between the four methods and areas of object creation, 4. How to declare a class
- leetcode-593:有效的正方形
- Bug fix: Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255]
- 【AD】【持续更新ing】关于AD设计过程中一些小细节
- golang文件行号探索
- The demand for VR live broadcast marketing is increasing, and the data module is paving the way for us
- LeetCode 0593. 有效的正方形
- 网安学习-内网渗透2
- LeetCode 593 有效的正方形[数学] HERODING的LeetCode之路
- SwiftUI * @State 相关问题
猜你喜欢
随机推荐
OneNote 教程,如何在 OneNote 中做笔记?
LeetCode 0144. 二叉树的前序遍历:二叉树必会题
第3章业务功能开发(线索关联市场活动,插入数据并查询)
QT安装、创建项目与调试,在VS中的使用:手把手教程
怎么实现您的个人知识库?
刘畊宏男孩女孩看过来!运动数据分析挖掘!(附全套代码和数据集)
Break the rules!MongoDB introduces SQL?
json-c实现json和结构体之间的相互转换
MySQL - 设计游戏用户信息表
LeetCode--single linked list--146.LRU cache
First thoughts on the first attempt to avoid killing without a file (Part 1)
亚马逊登录参数metadata1,encryptedPwd逆向分析
Liu Genghong, boys and girls, come here!Sports data analysis and mining!(with a full set of code and data sets)
940. Different subsequences II
Huawei Enjoy 50 Pro evaluation: HarmonyOS blessing is smoother and safer
.NET 6.0中使用Identity框架实现JWT身份认证与授权
普洛斯荣获两项“数据中心绿色等级评估”5A级认证
Bug fix: Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255]
TCP协议详解
容器网络硬核技术内幕 (22) 安全与自由兼顾









