文件管理系统文件上传
This commit is contained in:
parent
5e929e565f
commit
608006b614
|
|
@ -27,9 +27,9 @@ ftp:
|
|||
# 字符集编码
|
||||
encoding: UTF-8
|
||||
# 资源域名末尾以/结尾
|
||||
resources: https://download.odliken.top
|
||||
#后端部署域名
|
||||
apiurl: http://localhost:8085
|
||||
resources: https://resources.ebts.top
|
||||
#后端文件预览域名指向上面 ebts.profile 配置的文件路径
|
||||
apiurl: http://apiurl.ebts.top
|
||||
# 公开目录
|
||||
pubfiles: pubfiles
|
||||
# 保护目录
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ public class FileUploadUtils {
|
|||
private static final String getPathFileName(String uploadDir, String fileName) throws IOException {
|
||||
int dirLastIndex = EBTSConfig.getProfile().length() + 1;
|
||||
String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
|
||||
String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
|
||||
String pathFileName = "/" + currentDir + "/" + fileName;
|
||||
return pathFileName;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @Author 18209
|
||||
|
|
@ -154,7 +155,7 @@ public class FtpUtils {
|
|||
* @return
|
||||
*/
|
||||
public static SysFile uploadFtp(SysFile sysFile) {
|
||||
String dir = EBTSConfig.getProfile() + sysFile.getFileAddr().substring(baseDir.length());
|
||||
String dir = EBTSConfig.getProfile() + sysFile.getFileAddr();
|
||||
String ftpdir = "/";
|
||||
if (sysFile.getIsPublic().equals("1")) {
|
||||
ftpdir += pubfiles;
|
||||
|
|
@ -330,7 +331,7 @@ public class FtpUtils {
|
|||
}
|
||||
|
||||
public static final String getExtension(String fileName) {
|
||||
return FilenameUtils.getExtension(fileName);
|
||||
return FilenameUtils.getExtension(fileName.toLowerCase());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue