HOW TO ACCESS DROPBOX FILES

Giorgio Sfiligoi 656 Reputation points
2026-09-17T10:25:12.6933333+00:00

I would like to access my files stored in Dropbox from a NET MAUI app.

Can anybody provide a tutorial or sample?

Developer technologies | .NET | .NET Multi-platform App UI

4 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 85,456 Reputation points
    2026-09-26T20:27:58.28+00:00

    The main coding challenge is coding the oauth authentication. The user must login with a browser or hosted web-view. After the user authentication, the login site redirects back to the application via an application redirect url. With a mobile app this a redirect defined in the manifest.

    For your app to login via Dropbox, you define an application at Dropbox. The Dropbox application will have a clientid which you use in the mobile app and you will add your mobile app as a redirect/reply url.

    You should look at Maui’s web authenicator:

    https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/communication/authentication?view=net-maui-10.0&tabs=windows

    The authentication will return an access token which typically is valid for an hour or so. You pass this with the bearer header when making api requests. At login you can also request a refresh token. A refresh token has a longer life than an access token and can be used to get a new access token.

    Was this answer helpful?

    0 comments No comments

  2. Harry Nguyen (WICLOUD CORPORATION) 95 Reputation points Microsoft External Staff Moderator
    2026-09-18T06:37:34.8966667+00:00

    Hi @Giorgio Sfiligoi ,

    Thanks for sharing the details and the issues you encountered. I looked into this further, and here is a straightforward approach you can use to access Dropbox files from a .NET MAUI application.

    1. Set up the Dropbox app

    Start by creating an app in the Dropbox App Console.

    Choose the content access based on what your application needs:

    • App Folder if your app only needs access to its own Dropbox folder.
    • Full Dropbox if it needs access to existing content elsewhere in the user's Dropbox.

    Then enable only the permissions required for the operations your application needs. For example:

    • files.metadata.read for listing and browsing files and folders.
    • files.content.read for reading or downloading file content.
    • files.content.write if you later need to upload files.

    2. Add the Dropbox .NET SDK

    Install the official Dropbox SDK in your MAUI project:

    dotnet add package Dropbox.Api 
    

    For an initial test with your own Dropbox account, you can generate an access token from the OAuth 2 section of your Dropbox app settings.

    I would recommend using this initially to verify that the Dropbox app configuration, permissions, and file operations are working correctly. The token should not be embedded in your source code or included in a distributed application.

    List files from the MAUI application

    Once you have a test access token, you can create a DropboxClient and use the Files API:

    using Dropbox.Api; 
    
    public async Task ListFilesAsync(string accessToken) 
    
    { 
    
       using var client = new DropboxClient(accessToken); 
    
       var result = await client.Files.ListFolderAsync(string.Empty); 
    
       foreach (var entry in result.Entries) 
    
       { 
    
           System.Diagnostics.Debug.WriteLine(entry.Name); 
    
       } 
    
    } 
    

    The returned entries can then be displayed in a MAUI CollectionView or another UI control.

    To browse a specific folder, pass its Dropbox path to ListFolderAsync. If Dropbox indicates that additional entries are available, make sure to handle pagination rather than relying only on the first result.

    3. Read or download a selected file

    Once listing and folder navigation are working, you can use the same DropboxClient to retrieve the content of a selected file.

    For example, for a small text file, the application can download the content and display it in the MAUI UI. This requires the corresponding content-read permission in addition to metadata access.

    I would start by confirming that listing, browsing, and reading a file work correctly before extending the application with additional operations such as saving downloads locally or uploading files.

    The Dropbox API Explorer can also help verify individual Dropbox API requests and permissions independently. However, it is primarily a Dropbox API testing resource rather than a .NET MAUI-specific implementation guide.

    If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.

    Thank you.

    Was this answer helpful?


  3. Senthil kumar 2,500 Reputation points
    2026-09-17T12:08:32.8866667+00:00

    Hi @Giorgio Sfiligoi

    Attached the link for tutorial and sample documents.

    Dropbox .NET SDK

    https://github.com/dropbox/dropbox-sdk-dotnet

    Dropbox OAuth Guide

    https://developers.dropbox.com/oauth-guide

    Dropbox API Explorer

    https://dropbox.github.io/dropbox-api-v2-explorer/

    Thanks

    Was this answer helpful?


  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.