Spring Boot Undertow 上传文件后没有可读权限
Java Spring Boot Undertow 大约 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);
阅读 3996 · 发布于 2019-04-08
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
Docker 部署 Tomcat阅读 448
-
MySQL 数据库设置 root 密码阅读 860
-
AndroidStudio non-zero value 1 错误阅读 809
-
MySQL5.7 搭建主从-传统方式阅读 598
-
Mircosoft Edge 默认搜索引擎更改无效解决办法阅读 3427
-
Linux 查看文件夹总大小阅读 1437
-
Java 中 null == 和 == null 判断是否为 null 的区别阅读 2011
-
为什么匿名内部类引用外部局部变量必须要加 final 关键字阅读 111
-
走进 Rust:流程控制阅读 1219
-
Android ListView 条目点击变色阅读 1686