Commit c7086c71 authored by liqin's avatar liqin 💬

bug fixed

parent 34646b81
......@@ -4,6 +4,7 @@ import cn.wisenergy.common.utils.*;
import cn.wisenergy.model.app.shopZx;
import com.alibaba.fastjson.JSON;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
......@@ -58,7 +59,7 @@ public class UploadServiceImpl implements UploadService {
Long time = System.currentTimeMillis();
//.getOriginalFilename()
String zxName = file.getName();//文件原始名称
String suffixName = zxName.substring(zxName.lastIndexOf("."));//从最后一个.开始截取。截取zxName的后缀名
String suffixName = "." + FilenameUtils.getExtension(zxName);
String newzxName = time+suffixName; //文件新名称
//设置文件存储路径,可以存放在你想要指定的路径里面
String rootPath=basePath+File.separator+"upload/video/"; //上传视频存放位置
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment