douyu4535 2013-03-07 21:31
浏览 34

Dropbox使用PHP创建一个没有cURL的文件夹

I am following this tutorial http://fabi.me/en/php-projects/dropphp-dropbox-api-client/.

I managed to authenticate the app using the sample.php and tested it using the sample.php

Now I am trying to create a folder using the SDK but I do not know how to go about it. At points 2 and 3 the code seems garbled.

I tried this till now:

<?php

error_reporting(E_ALL);
require_once("DropboxClient.php");


$dropbox = new DropboxClient(array('app_key' => "YOUR_APP_KEY",
'app_secret'=> "YOUR_APP_SECRET",'app_full_access' => false,),'en'); 


$this->apiCall("fileops/create_folder", "POST", array('root' => , 'path' => ));
?>

I obviously changed YOUR_APP_KEY and YOUR_APP_SECRET with my own for security reasons.

I can't manage to create the folder / directory. Is there something wrong in my php code?

  • 写回答

1条回答 默认 最新

  • dphg63476 2013-03-07 21:44
    关注

    Try add curl_setopt($context, CURLOPT_UPLOAD,1);

    If you are on VPS do I removed the 1.1.0 (sudo pecl uninstall oauth), than downloaded 1.0.0 from the oauth page and built oauth.so from source, and since then everything work.;

    For DropPHP disable cURL as: $myDropPHP->SetUseCurl(false);

    If you didn't sure why isn't work try dump a data as simple:

    $dump = $this->apiCall("fileops/create_folder", "POST", array('root' => , 'path' => ));
    var_dump($dump); exit;
    

    This will go to you for find why is error or not working... Or view on log PHP file for errors (tail -f /var/log/error.log)

    Or... https://serverfault.com/questions/485285/install-oauth-extension-for-php-in-debian-wheezy

    Try using DROPBOX PEAR: http://pear.dropbox-php.com/

    You can instead of this fix, use DROPBOX PHP API client: http://www.dropbox-php.com/

    This code you have it's maybe outdated or conflicted with some library for an older version (worked) but on newer not solved. This needs manually change in code. Use DROPBOX PHP API client on above link and tell if it's worked.

    I found a Dropbox API on Codecanyon look at simple YT link: http://www.youtube.com/watch?v=Y3Gy5Ci3sog

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作