spatie / flysystem-dropbox

A flysystem driver for Dropbox that uses the v2 API
https://freek.dev/734-dropbox-will-turn-off-v1-of-their-api-soon-its-time-to-update-your-php-application
MIT License
343 stars 50 forks source link

could not list/get subfolders #16

Closed OskarStark closed 7 years ago

OskarStark commented 7 years ago

Could not list subfolders:

$client = $this->getContainer()->get('dropbox.client');
$adapter = new DropboxAdapter($client);
$flysystem = new Filesystem($adapter);

$folders = $flysystem->listContents('FOO');
dump($folders);

produces:

array:9 [
  0 => array:5 [
    "path" => "FOO/BAR"
    "type" => "dir"
    "dirname" => "FOO"
    "basename" => "BAR"
    "filename" => "BAR"
  ]
  1 => array:5 [
    "path" => "FOO/BAZ"
    "type" => "dir"
    "dirname" => "FOO"
    "basename" => "BAZ"
    "filename" => "BAZ"
  ]

the next part should show the content of FOO/BAR:

$files = $flysystem->listContents($folders[0]['path']);

but this returns an empty array. When i switch to a local adapter, my code is working... any ideas?

When I use this:

$client = $this->getContainer()->get('dropbox.client');
$adapter = new DropboxAdapter($client);
$flysystem = new Filesystem($adapter);

$folders = $flysystem->listContents('FOO/BAR');

I get the following error message: screenshot 2017-06-19 15 27 07

freekmurze commented 7 years ago

I know Dropbox is a little bit tricky with capitals. Could you make everything lowercase?

Freek Van der Herten Samberstraat 69 D 2060 Antwerpen T: +32 3 292 56 79 M: +32 495 84 27 91 https://spatie.be

On 19 June 2017 at 15:23, Oskar Stark notifications@github.com wrote:

Could not list subfolders:

$client = $this->getContainer()->get('dropbox.client');$adapter = new DropboxAdapter($client);$flysystem = new Filesystem($adapter);$folders = $flysystem->listContents('FOO');dump($folders);

produces:

array:9 [ 0 => array:5 [ "path" => "FOO/BAR" "type" => "dir" "dirname" => "FOO" "basename" => "BAR" "filename" => "BAR" ] 1 => array:5 [ "path" => "FOO/BAZ" "type" => "dir" "dirname" => "FOO" "basename" => "BAZ" "filename" => "BAZ" ]

the next part should show the content of FOO/BAR:

$files = $flysystem->listContents($folders[0]['path']);

but this returns an empty array. When i switch to a local adapter, my code is working... any ideas?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/spatie/flysystem-dropbox/issues/16, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdiDSXsU8JmxYF0PYxx0EexPSf89NTPks5sFnZLgaJpZM4N-OOZ .

OskarStark commented 7 years ago

You mean rename the folder on dropbox.com or use foo/bar?

freekmurze commented 7 years ago

both

OskarStark commented 7 years ago

good to know, thank you for your feedback :+1:

freekmurze commented 7 years ago

If my suggestion did not work, reopen the issue.

vesper8 commented 5 years ago

@OskarStark did you figure it out? i've tried every combination and I can only list the contents of root folders, not subfolders. Also if I use the Spatie Dropbox API package directly, without making the flysystem adapter I mean, then I have no problem listing full paths

OskarStark commented 5 years ago

Are you using the cached adapter?

xavierhb commented 5 years ago

I have the exact same issue you originally posted @OskarStark. And same as @vesper8, if I do the same with local driver it works. Any ideas? I'm not using the cached adapter.