1 Star 0 Fork 191

陈庆涛 / csx-bsf-all

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
车江毅 提交于 2019-12-24 20:45 . 上传代码

文件上传集成说明

介绍

此模块集成,七牛文件服务;如果有需要,可以扩展阿里云等等云服务

依赖引用

<dependency>
	<artifactId>csx-bsf-file</artifactId>
	<groupId>com.yh.csx.bsf</groupId>
	<version>1.7.1-SNAPSHOT</version>
</dependency>

配置说明

## bsf file  集成
##file服务的启用开关,非必须,默认true
bsf.file.enabled=true 			
##file服务默认为七牛云,可以扩展其他的文件服务
bsf.file.provider=qiniu 	
##七牛云的accessKey	
bsf.file.qiniu.accessKey = 
##七牛云的securityKey	
bsf.file.qiniu.securityKey = 	
##七牛云的bucketName
bsf.file.qiniu.bucketName = 	
##七牛云的bucketUrl
bsf.file.qiniu.bucketUrl = 	 
bsf.file.qiniu.tempDir=

关于七牛云的使用,请参阅七牛云

使用示例

	@Autowired(required = false)
	private FileProvider fileProvider;

	/**
	*  文件上传
	*/
    @PostMapping("/upload")
    public CommonResponse<String> uploadFile(MultipartFile file) throws Exception {    	
    	return CommonResponse.success(fileProvider.upload(file.getInputStream(), file.getOriginalFilename()));
    }
	/**
	* 上传服务器本地文件
	*/    
    public CommonResponse<String> uploadLocalFile(String file) throws Exception {    	
    	return CommonResponse.success(fileProvider.upload(file, FileUtils.getFileName(file)));
    }
Java
1
https://gitee.com/qtchen/csx-bsf-all.git
git@gitee.com:qtchen/csx-bsf-all.git
qtchen
csx-bsf-all
csx-bsf-all
master

搜索帮助