Learn how to make the most out of the Dropbox Community here 💙!
Forum Discussion
Ruslan Shastkiv
2 months agoNew member | Level 1
Need help with file uploads to Dropbox for a charity website
Dear Dropbox,
I am working on a small website representing my charity organization, and I need to upload documents such as reports and other files to a static folder on Dropbox. These files should be accessible to guests of the website who can view the documents without the need for authentication.
I have encountered an issue where my access token frequently expires. I do not need user authentication via OAuth, as this is a public folder, and I simply want to upload files programmatically and allow users to view them.
Could you please advise on how I can:
- Upload files to Dropbox without OAuth or user authentication.
- Set up a static folder for public access to documents.
- Ensure that the access token does not expire frequently, or suggest an alternative solution for continuous file access.
I appreciate your help in resolving this issue.
Thank you,
- DB-Des
Dropbox Engineer
Hi Ruslan Shastkiv,
As Rich has mentioned, Dropbox does not offer long-lived access tokens. That said, following the steps on the provided guides should help you get long-term access tokens.
As far as creating a static folder for public access, you can easily create a folder via the /files/create_folder_v2 endpoint first. Once that folder has been created, and depending on your use case, you can:
- Create a shared link for the newly-created folder by sending a request to /sharing/create_shared_link_with_settings, for a broadcast-style sending use case.
- Make the newly-created folder a shared folder by sending a request to /sharing/share_folder, for a collaboration-style use case.
I hope you find this information helpful!
- Rich
Super User II
Ruslan Shastkiv wrote:
I have encountered an issue where my access token frequently expires.
Long-lived tokens were deprecated back in 2021 and can no longer be created. You now use refresh tokens to retrieve new short-lived tokens as needed. See here for more information:
Ruslan Shastkiv wrote:
Ensure that the access token does not expire frequently, or suggest an alternative solution for continuous file access.
Apps can still 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.
- Ruslan ShastkivNew member | Level 1
I am using the Dropbox API v2 to upload files to Dropbox from the admin panel of my charity website. The uploaded files are stored in a specific folder on Dropbox, and then I generate a download link for the file when a guest requests it.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,972 PostsLatest Activity: 7 hours 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!