One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
Musa2
3 years agoNew member | Level 2
upload file on dropbox by java
Hi all
I am working on creating a simple desktop program in Java, and I want to upload files via this program to Dropbox, but the problem is that the access token has a short life (temporary), how can I make the access token have a long life, or if I can use the App key and App secret?
I need a very simple solution like a function or a java example.
Thanks for any help.
- ЗдравкоLegendary | Level 20
- Greg-DB
Dropbox Staff
Musa2 As shown in the example Здравко linked to, you should use a DbxCredential if you need long-term access. The DbxCredential should contain a refresh token, which the SDK will use to automatically retrieve new short-lived access tokens whenever needed, without manual user interaction. Refer to the authorize examples to see how the authorization flow works to retrieve a refresh token.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,949 PostsLatest Activity: 40 minutes ago
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!