Това ще изтрие страница "common-data-fastdfs 使用说明"
. Моля, бъдете сигурни.
fastDfs版本 1.25
<dependency>
<groupId>com.yihu.base</groupId>
<artifactId>common-data-fastdfs </artifactId>
<version>${版本以项目中最新的版本为主}</version>
</dependency>
fast-dfs:
tracker-server: 11.1.2.9:22122 #服务器地址
connect-timeout: 2 #链接超时时间
network-timeout: 30
charset: ISO8859-1 #编码
http:
tracker-http-port: 80
anti-steal-token: no
secret-key: FastDFS1234567890
pool: #连接池大小
init-size: 5
max-size: 20
wait-time: 500
@Autowired
private FastDFSHelper fastDFSHelper
### 以输入流的方式上传文件
@param in 输入流
@param fileExtension 文件扩展名,不要带“.”
@param description 文件名称(中文)
@return 返回值的格式如下:
{
"groupName": "healthArchiveGroup",
"remoteFileName": "/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
"fid": "group1/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
"fileURL": "http://172.19.103.13/healthArchiveGroup/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg"
}
public ObjectNode upload(InputStream in, String fileExtension,String description) throws Exception{
}
### 上传本地文件
@param fileName 本地文件的绝对路径,如 C://Desert.jpg
@param description 文件备注, 可以为空
@return {"groupName":"group1","remoteFileName":"/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg"
{
"groupName": "healthArchiveGroup",
"remoteFileName": "/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
"fid": "group1/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
"fileURL": "http://172.19.103.13/healthArchiveGroup/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg"
}
public ObjectNode upload(String fileName, String description) throws Exception {
}
### 下载文件, 返回文件字节数组.
@param groupName 在fastdfs上的卷名
@param remoteFileName 在fastdfs上的路径
@return 文件的字节码
public byte[] download(String groupName, String remoteFileName) throws Exception{
}
### 下载文件到本地路径上.
@param groupName 在 fastDFS 上的卷名
@param remoteFileName 在 fastDFS 上的路径
@param localPath 本地路径
@return 是否下载成功
public String download(String groupName, String remoteFileName, String localPath) throws Exception {
}
### 删除文件
@param groupName
@param remoteFileName
public void delete(String groupName, String remoteFileName) throws Exception {
}
Това ще изтрие страница "common-data-fastdfs 使用说明"
. Моля, бъдете сигурни.