linux系统上传图片读取权限设置

有时候我们在linux系统上上传了图片,发现读取不了,这是由于图片文件的权限问题,

可以在代码中加入以下代码:

String path = uploadinstitutionfiles + institutionInf.getId();
String command = "chmod 775 " + path;
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec(command);
UploadUtil.filesUpload(multipartFile, path, name);// 上传

在上传路径path 前面赋权限chmod 775 

也可以赋予最高权限chmod 777

原文地址:https://www.cnblogs.com/hougebajie/p/7656867.html