Forum Discussion

MLPDev's avatar
MLPDev
New member | Level 2
2 years ago

File upload

Hi guys.
I'm creating a React app. I'm planning to save files uploaded by the user in my Dropbox. Is it possible through the API?

 

By the way, I tried using an access token generated from the Dropbox site, and it is working fine. However, after a couple of hours, the token expires, so I need to generate it again and update the code. Is there any solution using any of the Dropbox API?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Dropbox does offer an API you can use for listing, uploading, and downloading files, among other operations. You can find everything you need to get started with the Dropbox API, including documentation, tutorials, and SDKs here.

     

    Dropbox issues short-lived access tokens, which expire after a few hours. Apps can get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. Refresh tokens do not expire automatically and can be used repeatedly. You can find more information in the OAuth Guide and authorization documentation. There's a basic outline of processing this flow in this blog post which may serve as a useful example.