1、文件管理 post 文件操作:copy, mover, rename, delete
https://pan.baidu.com/rest/2.0/xpan/file?
method=filemanager
&access_token=121.b2cbf33a8adecdd264ca5d947e4e9cef.YgSolDXAZd3-yfTddGn-C_VNgB7wtjW6D_UygUe.6CU9Kg
&opera=copybody参数:async:0,filelist:[{"path":"/图片素材/1/识别前-image.rar","dest":"/图片素材/2","newname":"识别前的图片.rar","ondup":"fail"}]
2、上传
上传文件的目录为/apps/【你创建应用的名称】例如/apps/fristApp/,只能往这个目录下存东西;
(1)预上传:
https://pan.baidu.com/rest/2.0/xpan/file
?method=precreate
&access_token=121.b2cbf33a8adecdd264ca5d947e4e9cef.YgSolDXAZd3-yfTddGn-C_VNgB7wtjW6D_UygUe.6CU9Kgbody:
path:/apps/fristApp/1.jpg
size:642987
isdir:0
autoinit:1
block_list:["da288dceaafd7c97f1b09c594eac7868"]
(2) 分片上传
https://d.pcs.baidu.com/rest/2.0/pcs/superfile2
?method=upload
&access_token=121.b2cbf33a8adecdd264ca5d947e4e9cef.YgSolDXAZd3-yfTddGn-C_VNgB7wtjW6D_UygUe.6CU9Kg
&type=tmpfile
&path=/apps/fristApp/1.jpg
&uploadid=N1-MTA2LjExMy4zMi4xODY6MTYyMDEyMDkwNTo1NjM4Njc3MTg0ODEwODYwMzk=&partseq=0
######(3)创建文件
https://pan.baidu.com/rest/2.0/xpan/file?
method=create
&access_token=121.b2cbf33a8adecdd264ca5d947e4e9cef.YgSolDXAZd3-yfTddGn-C_VNgB7wtjW6D_UygUe.6CU9Kgbody:
path:/apps/fristApp/1.jpg
size:642987
isdir:0
block_list:["da288dceaafd7c97f1b09c594eac7868"]
3、下载
文件下载:dlink为下载的连接
文件详情:
https://pan.baidu.com/rest/2.0/xpan/multimedia?method=filemetas
&access_token=121.b2cbf33a8adecdd264ca5d947e4e9cef.YgSolDXAZd3-yfTddGn-C_VNgB7wtjW6D_UygUe.6CU9Kg
&fsids=[1102387700665928]
&dlink=1
获取到下载地址可以直接下载。