Spring Boot Undertow 上传文件后没有可读权限
Java Spring Boot Undertow 评论 1 大约 601 字现象
Undertow 上传文件至 Nginx 静态服务器后发现 group 和 other 没有读写权限
设置权限,伪代码
MultipartFile file;
String pathname = "/home/pic/aaa.jpg";
File f = new File(pathname);
file.transferTo(f);
log.info("transfer to: " + pathname);
Set<PosixFilePermission> perms = new HashSet<>();
perms.add(PosixFilePermission.OWNER_READ);
perms.add(PosixFilePermission.OWNER_WRITE);
perms.add(PosixFilePermission.GROUP_READ);
perms.add(PosixFilePermission.OTHERS_READ);
//Set<PosixFilePermission> permissions = PosixFilePermissions.fromString("rw-r--r--");
Files.setPosixFilePermissions(Paths.get(pathname), perms);
阅读 5653 · 发布于 2019-04-08
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
-
丢丢 1楼
解决方案是这个,造成的原因是什么
Chrome | Windows 8.1 2023-03-23
随便看看
换一批
-
为什么 HashMap 长度必须是 2 的 n 次幂阅读 1266
-
MyBatis Cause: java.lang.IndexOutOfBoundsException: Index: 5, Size: 5阅读 6591
-
Docker exec 进入容器报错解决方法阅读 2074
-
Java 中 sleep 和 wait 的区别阅读 1304
-
Nginx 配置之开启 Gzip 压缩阅读 3168
-
Spring 中的设计模式阅读 1248
-
Windows WSL 能 ping 通但 curl 无响应阅读 3069
-
Linux smaps_rollup 及 status 查看 Java 进程内存占用阅读 341
-
Kubernetes Namespaces 相关命令阅读 1005
-
MySQL 中文全文检索 ngram 处理停止词阅读 4379