想自建网盘但是又苦于数据太大,购买大存储容量的VPS主机价格太贵?不妨试试ZPan自建网盘存储。ZPan致力于打造一款不限速的网盘系统,因此采用客户端直连云存储的方式进行设计,即它不支持本地存储,你的所有数据都是存在第三方存储商那里。
目前ZPan支持所有兼容S3协议的云存储平台,包括阿里云OSS 、腾讯云COS 、七牛云Kodo 、Ucloud US3(暂不支持自动设置CORS) 、华为云OBS 、网易云NOS(暂不支持自动设置CORS) 、亚马逊S3 、MinIO等,也就是说你可以将数据存储在大厂那里。
ZPan本质上是一个URL签名服务器+可视化的文件浏览器,采用直链的方式进行上传下载,所以为了保证上传下载的安全性,客户端用来上传下载的URL均需要服务端进行签名。特色是:完全不受服务器带宽限制,支持文件及文件夹分享(未登录可访问) 。
![图片[1]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/674db-zpan_00-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
ZPan网盘支持文档预览及音视频播放,支持多用户存储空间控制,将它打造为一个个人用的网盘或者小团队用的网盘是足够的。
网站:
- 官网:https://zpan.space/
- 项目:https://github.com/saltbo/zpan
一个VPS主机(必备)。ZPan为非PHP,所以不能安装在虚拟主机上,你需要准备一台VPS主机,对于速度有要求的可以选择国外的CN2 GIA线路的VPS主机。
一个域名(可选)。这个为可选,绑定域名主要是为了方便使用域名访问,且可以添加SSL证书,对于想要长期使用的朋友来说这个是必需的。当然,你如果习惯用IP访问也没有问题。
二、ZPan自建网盘安装
对于Linux系统(以CentOS为例),ZPan网盘直接使用以下命令安装即可。
curl -sSf https://dl.saltbo.cn/install.sh | sh -s zpan
systemctl start zpan
systemctl status zpan
systemctl enable zpan
systemctl stop zpan
对于已经在自己的VPS主机安装了宝塔面板的朋友,可以直接使用Docker安装的方法。关于宝塔面板的安装教程请看:宝塔面板安装与使用图文教程。
![图片[2]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/48c1d-zpan_01-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
输入镜像名称 saltbo/zpan:latest 获取镜像,然后是创建容器,端口映射 8222-8222,目录映射 /etc/zpan-/etc/zpan。
![图片[3]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/a3a41-zpan_02-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
ZPan使用Docker安装成功。
![图片[4]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/3a5b3-zpan_03-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
三、ZPan自建网盘配置
安装完成通过浏览器访问 ip:8222 即可进入配置界面。
![图片[5]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/bb8ea-zpan_04-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
数据库方面我们可以直接使用最简单的sqlite3,直接点击下一步就行。
![图片[6]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/ecc8f-zpan_05-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
如果你你想使用Mysql,那么先新建Mysql数据库(前提是你已经安装了Mysql),然后在DSN里填写对应数据库信息。
![图片[7]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/33fe2-zpan_05_1-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
然后就是配置管理员。
![图片[8]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/47ea4-zpan_06-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
提交完成配置,然后使用管理员登录,你还可以对Zpan的Web页面进行相应的调整。
![图片[9]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/b5673-zpan_07-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
ZPan支持添加第三方的SMTP服务,用于邮件注册、激活等。
![图片[10]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/49fc2-zpan_08-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
四、添加第三方存储
4.1 阿里云OSS
进入阿里云对象存储OSS控制台,Bucket 列表-创建Bucket,填写名称,选择地域,读写权限选择公共读。网盘关联的云存储设置为私有读,外链盘关联的云存储设置为公共读,看你个人选择。
![图片[11]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/9c125-zpan_09-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
进入RAM访问控制。
![图片[12]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/22f98-zpan_10-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
先创建一个用户。
![图片[13]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/a6a29-zpan_11-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
然后获得ID和Key,记得保存,否则下一秒它就不见了。
![图片[14]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/6db39-zpan_12-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
再返回点击刚刚创建的用户,给该用户授权,授权如下图:
![图片[15]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/4ec5b-zpan_13-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
现在回到ZPan,点击添加存储,选择OSS平台,填写OSS的名称和地域节点,AccessKey ID 和 Secret,配置如下图:
![图片[16]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/cd117-zpan_14-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
保存后,现在你可以返回到用户界面了,在这里你就可以开始上传文件了,上传的文件全部存储到阿里云的OSS中。
![图片[17]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/aea67-zpan_15-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
4.2 添加US3
US3为Ucloud的云存储产品,
![图片[18]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/20d6e-zpan_19-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
US3可以选择的机房位置也非常地多。
![图片[19]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/bdb45-zpan_20-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
接着,点击生成令牌。
![图片[20]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/beca2-zpan_22-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
令牌自成后记得保存ID和Key。
![图片[21]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/837af-zpan_23-680x366.png?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
最后就是添加存储了。
![图片[22]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/zpan_23_1.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
五、ZPan自建网盘使用
ZPan网盘自建网盘存储在线浏览图片。
[ad]
![图片[23]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/zpan_16.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
ZPan自建网盘存储幻灯片。
![图片[24]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/zpan_17.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
ZPan自建网盘存储在线观看视频。
![图片[25]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/zpan_18.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
六、使用域名访问ZPan
这一步为可选项。首先,对于用宝塔面板Docker方式部署的Zpan,你需要到宝塔面板后台创建一个网站。
![图片[26]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/zpan_25.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
然后为你的网站申请好SSL证书,用SSL访问会更安全些。当然,你执意不做,这一步也可以省略。
![图片[27]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/zpan_24.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
最后直接在宝塔面板后台点击创建反向代@理,目标URL为 ip:8222 (zpan运行端口)。
![图片[28]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/zpan_26.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
现在你就可以使用域名访问Zpan了。
![图片[29]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/zpan_27.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
以下部分的反向代理配置参考的是Cloudreve的绑定域名配置,原理都是一样的,你只需要把端口号换成ZPan的8222即可:Cloudreve绑定域名。
如果是LNMP,打开你的域名Nginx配置文件,在网站的server
字段中加入:
location ~ / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://127.0.0.1:5212;
# client_max_body_size 20000m; }
![图片[30]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/Cloudreve_05-680x366.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
如果是Oneinstack,打开你的域名Nginx配置文件,在网站的server
字段中加入:
location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://127.0.0.1:5212;
# client_max_body_size 20000m; }
![图片[31]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/Cloudreve_04-680x366.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
如果是Apache,在VirtualHost
字段下加入反代配置项ProxyPass
,比如:
<VirtualHost *:80> ServerName myapp.example.com ServerAdmin webmaster@example.com DocumentRoot /www/myapp/public
AllowEncodedSlashes NoDecod ProxyPass "/" "http://127.0.0.1:5212/" nocanon </VirtualHost>
添加完成后,重启nginx或者Apache,然后你就可以使用域名来访问了。
七、几个可能的问题
[ad]
7.1 CORS
由于Zpan网盘采用浏览器端直传,所以存在跨域问题,请进行如下跨域配置
Origin: http://your-domain AllowMethods: PUT AllowHeaders: content-type,content-disposition,x-amz-acl
或者你也可以直接使用*通配符来代替。
![图片[32]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/zpan_21.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
7.2 文件存储名
你可以通过环境变量进行配置,比如$RAW_PATH/$RAW_NAME,但是需要注意的是,在ZPan里移动文件或重命名都是不会改变存储路径的,在高级设置可以设置文件存储规则。
![图片[33]-自建网盘存储ZPan-基于各大云存储的网盘系统zpan安装使用教程-憬瑟流年](https://cdn.bifiv.com/wp-content/uploads/2021/05/zpan_28.png.webp?imageMogr2/format/webp/interlace/1/quality/100|watermark/1/image/aHR0cDovL3dhdGVybWFyay1jZC0xMjUyMTA2MjExLnBpY2NkLm15cWNsb3VkLmNvbS9ydmljaC0xMjUyNDQ0NTMzLzE1ODk5MDM0NjIucG5n/gravity/southeast/dx/10/dy/10)
支持的系统变量如下:
变量 | 介绍 | 例子 |
---|---|---|
$UID | 用户ID | 10001 |
$UUID | UUID | 6ba7b810-9dad-11d1-80b4-00c04fd430c8 |
$RAW_PATH | 初始上传路径 | 文稿/简历 |
$RAW_NAME | 初始文件名 | 张三-简历 |
$RAW_EXT | 初始文件后缀 | |
$RAND_8KEY | 8位随机字符 | mCUoR35r |
$RAND_16KEY | 16位随机字符 | e1CbDUNfyVP3sScJ |
$NOW_DATE | 当前时间-日期 | 20210101 |
$NOW_YEAR | 当前时间-年 | 2021 |
$NOW_MONTH | 当前时间-月 | 1 |
$NOW_DAY | 当前时间-日 | 1 |
$NOW_HOUR | 当前时间-时 | 12 |
$NOW_MIN | 当前时间-分 | 30 |
$NOW_SEC | 当前时间-秒 | 10 |
$NOW_UNIX | 当前时间-时间戳 | 1612631185 |
文章出自:挖站否 https://wzfou.com/zpan/,版权所有。
暂无评论内容