簡體   English   中英

我如何訪問Dropbox php中的文件夾

[英]how can i access the folders in Dropbox php

我正在嘗試在Dropbox中讀寫文件夾。 所以我已經在DropBox中注冊了我的應用程序。

我的應用程序的詳細信息是..

權限類型 App文件夾

應用文件夾名稱你好

現在,“ hello”文件夾目前在此目錄中

https://www.dropbox.com/home/Apps/

所以當我這樣做

  $files = $this->DropboxApi->ls( );
        pr($files);

我得到的結果是這個

Array
(
    [Dropbox] => Array
        (
            [hash] => *****************
            [thumb_exists] => 
            [bytes] => 0
            [path] => /
            [is_dir] => 1
            [size] => 0 bytes
            [root] => app_folder
            [contents] => Array
                (
                )

            [icon] => folder
        )

)

所以這個問題是我不知道我怎樣才能訪問該文件夾打招呼

應該走什么路

$files = $this->DropboxApi->ls('Path);

假設您要在文件夾myfolder寫入文件名myfile.extension ,那么您的上傳路徑將是:

<root>/myfolder/myfile.extension

那么您要上傳文件的端點網址將是:

https://api-content.dropbox.com/1/files_put/dropbox/myfolder/myfile.extension

如果是下載,您首先需要向端點發送請求:

https://api.dropbox.com/1/media/dropbox/myfolder/myfile.extension

作為響應,您將獲得json,例如: {"url":"here is downloadable link"}

要查看文件夾中的內容/詳細信息,端點將為:

https://api.dropbox.com/1/metadata/dropbox/hello?list=true

$folder = $dropbox->GetFiles("hello",false);

它將所有文件返回到hello文件夾(返回數組)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM