1.下载官方上传工具
http://oss.tanguu.com/qshell_win.exe
官方下载的,修改文件名字
2.编写脚本:file.bat
@echo off & setlocal EnableDelayedExpansion
set dir=E:\1-work\20210101\qiniu-upload-file\%1\*
set fileprefix=%2
set files=file.txt
for %%i in (%dir%) do (
set filepath=%%i
set filename=!filepath:~44!
.\qshell_win.exe fput tangzhq !fileprefix!!filename! !filepath!
echo !filename! >> !files!
)
3.使用
设置账号
#ac,ak七牛官方申请分配的,在个人中心的密钥管理
./qshell account ac ak
执行脚本
#脚本参数说明:1上传文件所在的目录名 2设置文件名的前缀
./file.bat 23 static/upload/images/goods/2020/06/