在使用Dropbox API的PHP中,通过将路径作为参数传递,将一个文件或文件夹从一个位置移动到另一个位置?
我有这段代码在使用Dropbox API的PHP中,通过将路径作为参数传递,将一个文件或文件夹从一个位置移动到另一个位置?,php,dropbox-api,Php,Dropbox Api,我有这段代码 $str1 = $test."\\".$actualfilename; $str2 = $finalPath."\\".$folder."\\".$subfolder; $source = mb_convert_encoding($str1, "UTF-8"); echo "<br/>". $source; $dest = mb_convert_encoding($str2, "UTF-8"); echo "<br/>" .$dest; $clie
$str1 = $test."\\".$actualfilename;
$str2 = $finalPath."\\".$folder."\\".$subfolder;
$source = mb_convert_encoding($str1, "UTF-8");
echo "<br/>". $source;
$dest = mb_convert_encoding($str2, "UTF-8");
echo "<br/>" .$dest;
$client->move($source,$dest);
错误消息表明
fromPath
应以“/”
开头,但您的路径应以“C:\\”
开头
在Dropbox API上执行这样的文件操作时,远程文件路径需要是Dropbox文件夹中的相对路径。也就是说,类似于“/folder/file.txt”
而是传递本地文件路径。要解决此问题,请改用帐户中文件的相对路径
Fatal error: Uncaught exception 'InvalidArgumentException' with message ''fromPath': bad path: must start with "/": "C:\\Dropbox\\Salesforce Documents\\Opportunities\\UR-000001\\123432.pdf.txt"' in D:\xampp\htdocs\dropboxapi\vendor\dropbox\dropbox-sdk\lib\Dropbox\Path.php:169