当前位置:网站首页>获取七牛云地址文件保存到本地
获取七牛云地址文件保存到本地
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;
}
边栏推荐
- 4. SAP ABAP OData 服务 Data Provider Class 的 GET_ENTITYSET 方法实现指南
- GET_ENTITYSET Method Implementation Guide for SAP ABAP OData Service Data Provider Class
- 容器网络硬核技术内幕 (25) 知微知彰,知柔知刚 (中)
- The demand for VR live broadcast marketing is increasing, and the data module is paving the way for us
- MySQL数据查询 - 联合查询
- 太卷了,企业级的智慧物业系统,也完全开源....
- 刘畊宏男孩女孩看过来!运动数据分析挖掘!(附全套代码和数据集)
- Oracle问题: ORA-01882: 未找到时区
- 容器网络硬核技术内幕 (23) 权利,知识与责任
- 系列(jupyter自动保存失败)
猜你喜欢

无文件落地免杀的初尝试思考(上)

bright day

Cooler Navigation helps you shop easily in shopping malls without confusion

Cobaltstrike和BurpSuite桌面快捷配置

940. Different subsequences II

初识网络的简单概念

Cobaltstrike and BurpSuite desktop shortcut configuration

南信大提出TIPCB,一个简单但有效的用于基于文本的人员搜索的基于部分的卷积baseline

940. 不同的子序列 II

网络通信编程基础,BIO,NIO
随机推荐
PyQt5学习一(环境搭建)
解决报错 WARNING: IPv4 forwarding is disabled. Networking will not work.
酷客导航助你商场轻松购物,业务办理不迷茫
mdnice-test
7 行代码搞崩溃 B 站,原因令人唏嘘!
爽朗的一天
关于 golang 错误处理的一些优化想法
Cobaltstrike和BurpSuite桌面快捷配置
刚重装的win7系统不能上网(深度系统安装步骤)
LeetCode 593 有效的正方形[数学] HERODING的LeetCode之路
PointPillars 工程复现
GET_ENTITYSET Method Implementation Guide for SAP ABAP OData Service Data Provider Class
惠普服务器硬盘指示灯不亮或显示蓝色
全系都更换带T四缸,安全、舒适一个不落
全自动化机器学习建模!效果吊打初级炼丹师!
24小时伦敦金走势图分析
WPF 实现抽屉菜单
WeChat Mini Program 30 Customizing Templates and Obtaining User Login Credentials
最小jvm源码分析
The sword refers to Offer II 097. Number of subsequences