1
我有一个功能,在我的网站上下订单之后,将产品图片上传到保管箱。在Dropbox里面的文件夹里上传文件后的不好的路径
我自定义路径名称:
$dropBoxRoot = '/Comp#'.$user['company_id'].'/Prop#'.$user['object_id'].'/Order#'.$orderId.'/'.$product;
我检查,如果上述路径已经通过getDelta
功能存在。
//let's assume $this-client has already instantiated
$checkIfFolderExist = $this->client->getDelta(null, $dropBoxRoot);
在那之后,我上传的图像通过这样做:
//the actual path : /Comp#119/Prop#5/Order#120/Product1/image.png
$this->client->uploadFile($dropBoxRoot.'/'.$fileName, WriteMode::add(), $file, $size);
的图像在投寄箱上传。我可以在那里看到它的路径内,但上传后,在uploadFile
函数返回一个例外:
(1/1) InvalidArgumentException
'path': bad path: must start with "/": "image.png"
in Path.php (line 141)
如果任何人有同样的情况,我想问一下你的意见。提前致谢!