文件上传一直显示bad request

上传一个文件首先是获取到一个上传的地址 repo-id是我在设置->资源库中的列表复制的id,p=/
Get Upload Link
GET https://cloud.seafile.com/api2/repos/{repo-id}/upload-link/?p=/upload-dir
然后用php curl上传文件
$ch = curl_init();
$headr[] = ‘Authorization: Token 7ebaa540838db67121dcd71818f3224f3458658c’;
//file就是文件在本地服务器的地址,利用post方式上传上去
$data = array(
‘filename’ => ‘post.txt’,
‘file’ => ‘@D:/post.txt’ ,
‘parent_dir’ => ‘’);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
curl_setopt($ch, CURLOPT_URL, $_strUploadUrl); // $_strUploadUrl就是获取到的上传地址
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER[‘HTTP_USER_AGENT’]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$_result = curl_exec($ch);
print_r(curl_error($ch));
print_r(curl_getinfo($ch));
print_r($_result);exit;

一直显示{“error”: “Bad request.”} 请问是什么原因?

你现在上传好了吗,我的第一次拿地址没啥问题,再次提交讲path,404