1

I'm in need to read a large number of files from a permanent Dropbox webpage.

The reading part is fine, but I'm having troubles finding a way to list all the files contained within. To be more precise, I would need something like

files = dir([url_to_Dropbox_directory,'*.file_extension']);

returning the names of all the files.
I've found an example in php, but nothing for MATLAB. Using dir was just an example, I'm looking for any solution to this problem.

How can I get the file list from a permanent Dropbox webpage?

Adriaan
  • 17,741
  • 7
  • 42
  • 75
Matteo V
  • 1,163
  • 1
  • 8
  • 17
  • Are the Dropbox files synced to your computer? Then you can just use the path instead of a URL. – Adriaan Aug 27 '20 at 13:51
  • Unfortunately no, there are way too many files to download locally. – Matteo V Aug 27 '20 at 13:59
  • 1
    Then that's not going to work out of the box. `dir` supports S3 and Azure storage as far as I know, but it won't support dropbox – Paolo Aug 27 '20 at 14:01
  • `dir` was just an example, I'm looking for any (if there is!) solution to get the list of files contained. (Also updated in the question) – Matteo V Aug 27 '20 at 14:07
  • 2
    You can use the [`dropbox API`](https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder), and pass the curl command in the [`webwrite`](https://mathworks.com/help/matlab/ref/webwrite.html) function. – obchardon Aug 27 '20 at 14:43

1 Answers1

0

You should use the Dropbox API where you can acces that data by a http request. "file-list-folder" is the specific endpoint that you are looking for.

Here is the documentation for it:

https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder

In addition you could use the SDK for PHP (or others programming languages). I have used the SDK for JS and it's easy and works well.

PHP SDK:

https://dropbox.github.io/dropbox-sdk-php/api-docs/v1.1.x/

Bruno Pop
  • 74
  • 3