搜索文档
本地文件系统适合开发环境或小规模应用场景,生产环境建议使用云存储服务。
pigx-upms-biz-dev.yml
file: bucketName: s3demo # 存储桶名称 local: enable: true # 启用本地文件系统 base-path: /data # 文件存储路径
在 pom.xml 中添加文件系统依赖:
pom.xml
<!--文件系统--> <dependency> <groupId>com.pig4cloud</groupId> <artifactId>pigx-common-oss</artifactId> </dependency>
@Autowired private FileTemplate template; // 上传文件到指定桶 template.putObject("s3demo", fileName, file.getInputStream());