更改上传到视频云存储的文件名称
parent
0ba972b0d4
commit
8e446d19e9
|
@ -216,7 +216,7 @@ public class VideoServiceImpl implements VideoService {
|
||||||
String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")).toLowerCase();
|
String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")).toLowerCase();
|
||||||
String fileName = result + fileExt;
|
String fileName = result + fileExt;
|
||||||
vodConfig.put("filename",fileName); // 此参数不重要,只要能保留文件后缀名如 a.mp4 即可
|
vodConfig.put("filename",fileName); // 此参数不重要,只要能保留文件后缀名如 a.mp4 即可
|
||||||
vodConfig.put("vn", result); // .. . 分组配置、回调参数
|
vodConfig.put("vn", fileName); // .. . 分组配置、回调参数
|
||||||
JSONObject body = new JSONObject();// 构建body对象
|
JSONObject body = new JSONObject();// 构建body对象
|
||||||
body.put("channel", "VOD_UPLOAD");
|
body.put("channel", "VOD_UPLOAD");
|
||||||
body.put("vodConfig", vodConfig);
|
body.put("vodConfig", vodConfig);
|
||||||
|
@ -253,7 +253,7 @@ public class VideoServiceImpl implements VideoService {
|
||||||
File localFile = new File(filePath);
|
File localFile = new File(filePath);
|
||||||
// 计算文件的 SHA-256 哈希值(比MD5加密更安全)
|
// 计算文件的 SHA-256 哈希值(比MD5加密更安全)
|
||||||
String fileMD5 = calculateFileSHA256(localFile);
|
String fileMD5 = calculateFileSHA256(localFile);
|
||||||
System.out.println("SHA-256加密内容为:{}"+fileMD5);
|
System.out.println("SHA-256加密内容为:"+fileMD5);
|
||||||
// 检查目录是否存在,如果不存在则创建
|
// 检查目录是否存在,如果不存在则创建
|
||||||
File localDirectory = localFile.getParentFile();
|
File localDirectory = localFile.getParentFile();
|
||||||
if (!localDirectory.exists()) {
|
if (!localDirectory.exists()) {
|
||||||
|
|
Loading…
Reference in New Issue