文件上传显示
网上找的配置如下:
@Configuration
public class MyWebAppConfigurer implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
String resourceLocations = “file:” + FileUploadUtil.filerootpath;
registry.addResourceHandler("/file/**").addResourceLocations(resourceLocations);
}
}
在windows下能访问到图片
filerootpath = D://uploadFiles/
在Linux 下面不能访问图片
filerootpath = /hitachirdc_data_upload
权限没赋予吧