0

我使用的是推荐的 php script dropbox https://github.com/BenTheDesigner,可以得到 json 响应,也可以列出文件。

即这是我的开发者帐户中来自test.php 的文件的输出。

This is a list of all files in your [APP] Dropbox.

 api_upload_test.txt45 bytes
 dsdsdsdsdsdsd0 bytes
  ghhhhhhhhhhhh0 bytes
If I Fell - The Beatles.mp31 MB
 Koala.jpg762.5 KB
 test_download_api_upload_test.txt45 bytes

但我需要这些文件的绝对网址。即http : //something/sandbox/folder/Koala.jpg

或 http://某事/fileget/http://某事/koala.jpg

我找不到有关指定 url 或是否使用 Dropbox url 的任何信息。可能是一个愚蠢而简单的答案。

This is an example of the array;
    array(3) {
       ["code"]=>
      string(3) "200"
      ["body"]=>
     object(stdClass)#8 (9) {
        ["hash"]=>
    string(32) "df98863d80aa0c89f5e359a4f3e10b5a"
    ["thumb_exists"]=>
    bool(false)
    ["bytes"]=>
    int(0)
    ["path"]=>
    string(1) "/"
    ["is_dir"]=>
    bool(true)
    ["size"]=>
    string(7) "0 bytes"
    ["root"]=>
    string(10) "app_folder"
    ["contents"]=>
    array(6) {
      [0]=>
      object(stdClass)#9 (12) {
        ["revision"]=>
        int(1)
        ["rev"]=>
        string(9) "109a31b3c"
        ["thumb_exists"]=>
        bool(false)
        ["bytes"]=>
        int(45)
        ["modified"]=>
        string(31) "Tue, 21 Aug 2012 12:26:04 +0000"
        ["client_mtime"]=>
        string(31) "Tue, 21 Aug 2012 12:26:04 +0000"
        ["path"]=>
        string(20) "/api_upload_test.txt"
        ["is_dir"]=>
        bool(false)
        ["icon"]=>
        string(15) "page_white_text"
        ["root"]=>
        string(7) "dropbox"
        ["mime_type"]=>
        string(10) "text/plain"
        ["size"]=>
        string(8) "45 bytes"
      }
      [1]=>
      object(stdClass)#10 (10) {
        ["revision"]=>
        int(3)
        ["rev"]=>
        string(9) "309a31b3c"
        ["thumb_exists"]=>
        bool(false)
        ["bytes"]=>
        int(0)
        ["modified"]=>
        string(31) "Tue, 21 Aug 2012 14:09:26 +0000"
        ["path"]=>
        string(14) "/dsdsdsdsdsdsd"
        ["is_dir"]=>
        bool(true)
        ["icon"]=>
        string(6) "folder"
        ["root"]=>
        string(7) "dropbox"
        ["size"]=>
        string(7) "0 bytes"
      }
      [2]=>
      object(stdClass)#11 (10) {
        ["revision"]=>
        int(4)
        ["rev"]=>
        string(9) "409a31b3c"
        ["thumb_exists"]=>
        bool(false)
        ["bytes"]=>
        int(0)
        ["modified"]=>
        string(31) "Tue, 21 Aug 2012 15:29:22 +0000"
        ["path"]=>
        string(14) "/ghhhhhhhhhhhh"
        ["is_dir"]=>
        bool(true)
        ["icon"]=>
        string(6) "folder"
        ["root"]=>
        string(7) "dropbox"
        ["size"]=>
        string(7) "0 bytes"
      }
4

1 回答 1

1

Found a way of getting the url. The full path is not given in the array from dropbox. You have to specify media in the request, and the full path is given, which expires every 4 hours.

ie

$media = $dropbox->media($path);
于 2012-08-23T08:18:55.187 回答