You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

PerOstergren's avatar
PerOstergren
Explorer | Level 4
4 years ago

SwiftyDropbox: copy files from shared folder link to App folder, or download to local Documents

Very new to the platform, all help appreciated.   My aim is to populate my iOS app with some files that originally resides in a shared Dropbox folder, either by downloading them to the local device...
  • Greg-DB's avatar
    4 years ago

    To download a file from a shared link for a folder to the local device, you should use listFolder/listFolderContinue, to list the contents of the linked folder, and then getSharedLinkFile to download any needed file(s). When calling getSharedLinkFile, the 'path' should be the path of the file you want to download, relative to the linked folder, and the 'url' should be the shared link for the folder. You can determine the relative path from the metadata returned by listFolder/listFolderContinue, from the Metadata.name for the needed file(s). For example, if it's a file named "file.ext" in the linked folder, the path would be "/file.ext". Or, if it's nested in a subfolder named "subfolder" in the linked folder, the path would be "/subfolder/file.ext".

     

    Alternatively, you can save a file from a shared link for a folder directly to a connected Dropbox account by using getSharedLinkMetadata and saveUrl. You would call getSharedLinkMetadata with the 'url' and 'path' value (built the same was as above), to get the resulting SharedLinkMetadata.url for the specific file in the linked folder that you want. Then you would pass that to saveUrl as 'url' to save that file to the connected account.

     

    However, note that unfortunately there is currently a bug that will prevent getSharedLinkFile and getSharedLinkMetadata from working if your app has the "app folder" access type. That's currently open with engineering, but I don't have a timeline for a fix.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,887 PostsLatest Activity: 2 hours ago
326 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!