We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

jrcampins's avatar
jrcampins
Explorer | Level 4
8 years ago

command-line download app

I am trying to build an App to let other people (even non-Dropbox users) easily download files from a specific folder in my Dropbox. The App only needs to have read-only access to such folder.

Based on the examples, I built a very simple command-line download app. The app works just fine but I don't want to distribute it as it is, as my access token is hard-coded in it, and although its permission type is "App folder" and therefore its access should be limited to that folder it would be read-write access.

Could anybody please help me find a way build this App without sharing my access token and/or my secret key?

  • The API was designed with the intention that each user would link their own Dropbox account, in order to interact with their own files. However, it is technically possible to connect to just one account, as you've done, but we don't recommend doing so, for various technical and security reasons, like you mentioned.

    Anyway, there isn't a way to configure a read-only permission, but I'll pass this along as a feature request.

    Alternatively, you could consider using shared links to link to content in your Dropbox:

    https://www.dropbox.com/help/files-folders/view-only-access

    You can modify these links for direct access, e.g., to programmatically download from them:

    https://www.dropbox.com/help/desktop-web/force-download
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    The API was designed with the intention that each user would link their own Dropbox account, in order to interact with their own files. However, it is technically possible to connect to just one account, as you've done, but we don't recommend doing so, for various technical and security reasons, like you mentioned.

    Anyway, there isn't a way to configure a read-only permission, but I'll pass this along as a feature request.

    Alternatively, you could consider using shared links to link to content in your Dropbox:

    https://www.dropbox.com/help/files-folders/view-only-access

    You can modify these links for direct access, e.g., to programmatically download from them:

    https://www.dropbox.com/help/desktop-web/force-download
    • jrcampins's avatar
      jrcampins
      Explorer | Level 4

      Thanks a lot! Modifying the links for direct access solves my problem. Files can be downloaded very easily using FileUtils.copyURLToFile (no need for Dropbox's API).

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 5 hours ago
325 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!