【发布时间】:2014-05-19 18:41:20
【问题描述】:
我正在为 box.com 使用这个 php 类 https://github.com/golchha21/BoxPHPAPI
我已经做了自己的功能来共享这样的文件夹
public function share_folder($folder_id) {
$url = $this->build_url("/folders/".$folder_id);
$params = array('shared_link' => array('access' => 'open', 'permissions' =>
array('can_download' => 'true', 'can_preview' => 'true')));
return json_decode($this->post($url, json_encode($params)), true);
}
我和这篇文章有同样的问题。 Access denied error message when trying to create a shared link to a folder in Box
有人对此有解决办法或知道为什么会这样吗?
更新
我想通了:
public function share_folder($folder_id) {
$url = $this->build_url("/folders/".$folder_id);
$params = array('shared_link' => array('access' => 'open', 'permissions' =>
array('can_download' => true, 'can_preview' => true)));
return json_decode($this->put($url, $params), true);
我必须更改它以放置和取下 json_encode
希望这对其他人有帮助
【问题讨论】:
标签: php permissions box-api shared-directory