Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
pkd
3 years agoExplorer | Level 3
How do I upload file using Python
I've checked here and over at StackOverflow but couldn't find a solution. Nothing works.
It says that I need refresh token (I have no clue where to get it) and an app key.
import pathlib...
pkd
3 years agoExplorer | Level 3
Thank you but this is not what I asked for. I thought that there exists simple script that lets you ulpoad files to Dropbox.
I stopped using AWS S3 couple of months ago. I thought Dropbox would be easier in comparison for a small scale cloud storage but apparently it's not.
Thanks anyway.
Здравко
3 years agoLegendary | Level 20
pkd wrote:Thank you but this is not what I asked for. I thought that there exists simple script that lets you ulpoad files to Dropbox.
...
🤔Did you test the above script? It can perform upload of one or more files in pointed Dropbox place/folder! The simplest upload command would be:
dropbox_file upload <your local file> ""
dropbox_file upload img.jpg app_folder_dropbox
So, the pointed file would be upload to your home root. If you replace the empty string at the end with some Dropbox folder, then the file will be placed there. Exact syntax can be seen using:
dropbox_file --help
If you mean ready application to sync, yes, there is too. Take a look here.
- pkd3 years agoExplorer | Level 3
Good God, this seems so overly complicated. It's literally 10 lines of code for S3.
I think I'll use some other service instead of Dropbox.
- Greg-DB3 years ago
Dropbox Community Moderator
pkd I see Здравко helpfully shared a more fully-featured script, but much like what you originally shared, it is possible to upload to Dropbox using the API automatically once you process the authorization flow (which only needs to be done once) with minimal code.
The minimal usage to upload/overwrite a file over extended periods of time would look like this: (using credentials acquired using PKCE, like in Здравко's example)
import dropbox dbx = dropbox.Dropbox(oauth2_refresh_token="REFRESHTOKENHERE", app_key="APPKEYHERE") print(dbx.files_upload(b"some data here", "/upload_path/file.ext", mode=dropbox.files.WriteMode("overwrite")))- pkd3 years agoExplorer | Level 3
I chose "Allow public clients (Implicit Grant & PKCE)" in Settings but still there's no refresh token. Is it even possible to set this whole thing up using web interface at Dropbox?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!