# |
平台 |
别名 |
文件名称 |
原始文件名 |
文件大小 |
MIME |
基础存储路径 |
存储路径 |
删除 |
下载 |
<#if list?? && (list?size > 0)>
<#list list as row>
<#--${row.id} | -->
${row_index + 1} |
${row.platform!'-'} |
${row.alias!'-'} |
${row.filename!'-'} |
${row.originalFilename!'-'} |
${row.size!'-'} |
${row.contentType!'-'} |
${row.basePath!'-'} |
${row.path!'-'} |
@删除 |
@下载 |
#list>
#if>
```
## 如何自定义存储文件命名方法
```yaml
file:
storage:
fileNameMapping: cn.wubo.file.storage.demo.MD5FileNameMappingImpl
```
```java
@Component
public class MD5FileNameMappingImpl implements IFileNameMapping {
@Override
public String mapping(String s) {
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
byte[] hashedBytes = digest.digest(s.getBytes());
StringBuilder sb = new StringBuilder();
for (byte b : hashedBytes) {
sb.append(Integer.toString((b & 0xff) + 0x100, 16).substring(1));
}
return sb.toString();
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
}
```
### 如何通过docker安装MinIO
docker安装minio 详细内容请查看 [Download](https://min.io/download#/docker) 或者 [MinIO Object Storage for Container](https://min.io/docs/minio/container/index.html)
```bash
docker run -p 9000:9000 -p 9090:9090 --name minio -v D:\minio\data:/data -e "MINIO_ROOT_USER=ROOTUSER" -e "MINIO_ROOT_PASSWORD=CHANGEME123" quay.io/minio/minio server /data --console-address ":9090"
```
用户名 ROOTUSER 密码 CHANGEME123
### 如何通过Alist支持更多存储平台
[Alist --一个支持多种存储的文件列表程序](https://alist.nn.ci)
[sardine --an easy to use webdav client for java](https://github.com/lookfirst/sardine)
```bash
# docker安装
docker run -d --restart=always -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:latest
# 查看用户名和密码
docker exec -it alist ./alist admin
```