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
import dropbox
dropbox_access_token="my_token"
app_key="my_app_key"
folder = pathlib.Path(".")
filename = "img.jpg"
filepath = folder / filename
target = "/app_folder_dropbox/"
targetfile = target + filename
d = dropbox.Dropbox(dropbox_access_token, app_key=app_key)
with filepath.open("rb") as f:
meta = d.files_upload(f.read(), targetfile, mode=dropbox.files.WriteMode("overwrite"))
Is there simple Python script that lets you upload an image to Dropbox?