当前位置:网站首页>获取七牛云地址文件保存到本地
获取七牛云地址文件保存到本地
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;
}
边栏推荐
- WeChat Mini Program 31 Subcontracting Mechanism
- 系列(jupyter自动保存失败)
- 转:idea中language level设置
- 容器网络硬核技术内幕 (25) 知微知彰,知柔知刚 (中)
- The Ministry of Human Resources and Social Security announced that "database operation administrator" has become a new occupation, and OceanBase participated in the formulation of occupational standar
- 24小时伦敦金走势图分析
- AI全流程开发难题破解之钥
- [ACTF2020 新生赛]Exec 1
- 240. Searching 2D Matrix II
- SwiftUI Apple App Store 发布App的初学者完整指南
猜你喜欢

刘畊宏男孩女孩看过来!运动数据分析挖掘!(附全套代码和数据集)

《张卫国的夏天》欢乐来袭,黄磊、刘奕君携手演绎“冤种”兄弟

全系都更换带T四缸,安全、舒适一个不落

C语言操作符详解(1)

三品牌下半年将带来多款新品,东风日产将迎来“产品大潮”

The Ministry of Human Resources and Social Security announced that "database operation administrator" has become a new occupation, and OceanBase participated in the formulation of occupational standar

LeetCode 0144. 二叉树的前序遍历:二叉树必会题

华为畅享50 Pro评测:HarmonyOS加持 更流畅更安全

How to implement your personal knowledge base?

干货!联邦学习中的合作均衡
随机推荐
OneNote tutorial, how to take notes in OneNote?
Cobaltstrike and BurpSuite desktop shortcut configuration
Bug fix: Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255]
sizeof和strlen的区别(strlen和sizeof的用法)
从实例学Kettle(一):获取股票行情数据
【AD】【持续更新ing】关于AD设计过程中一些小细节
TCP协议详解
分布式之基石: 可靠性——What a tangled web we weave
leetcode122. Best Time to Buy and Sell Stock II
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
Analysis of Crypto in Pi 2
阿里 P8 爆出的这份大厂面试指南,看完工资暴涨 30k!
240. Searching 2D Matrix II
json-c实现json和结构体之间的相互转换
Come in now!!!Take you to know the basic data types of C language
容器网络硬核技术内幕 (22) 安全与自由兼顾
The cornerstone of distributed: reliability - What a tangled web we weave
A dish hold up valuations billions of mt. Pickled fish, can move beyond the edge food safety?
The sword refers to Offer II 097. Number of subsequences
Cobaltstrike和BurpSuite桌面快捷配置