upload file to my dropbox from python script(从 python 脚本上传文件到我的 Dropbox)
问题描述
我想将我的 python 脚本中的文件自动上传到我的 Dropbox 帐户.我无论如何都找不到只用一个用户/通行证来做到这一点.我在 Dropbox SDK 中看到的一切都与具有用户交互的应用程序有关.我只想做这样的事情:
I want to upload a file from my python script to my dropbox account automatically. I can't find anyway to do this with just a user/pass. Everything I see in the Dropbox SDK is related to an app having user interaction. I just want to do something like this:
https://api-content.dropbox.com/1/files_put//?user=me&pass=blah
https://api-content.dropbox.com/1/files_put//?user=me&pass=blah
推荐答案
重要提示:此答案已弃用,因为 Dropbox 现在使用 v2 API.
当前API版本解决方案见@SparkAndShine的回答
Important Note: this answer is deprecated since dropbox uses v2 API now.
See the answer of @SparkAndShine for current API version solution
感谢@smarx 的上述回答!我只是想为其他试图这样做的人澄清一下.
Thanks to @smarx for the answer above! I just wanted to clarify for anyone else trying to do this.
当然要先安装 dropbox 模块,
pip install dropbox
.
在应用程序控制台"中以您自己的 Dropbox 帐户创建应用程序.(https://www.dropbox.com/developers/apps)
Create an app under your own dropbox account in the "App Console". (https://www.dropbox.com/developers/apps)
为了记录,我使用以下内容创建了我的应用程序:
Just for the record I created my App with the following:
一个.应用类型为Dropbox API APP".
a. App Type as "Dropbox API APP".
b.数据访问类型为文件和数据存储"
b. Type of data access as "Files & Datastores"
c.文件夹访问权限为我的应用需要访问 Dropbox 上已有的文件".(即:权限类型为Full Dropbox".)
c. Folder access as "My app needs access to files already on Dropbox". (ie: Permission Type as "Full Dropbox".)
然后点击生成访问令牌"按钮并剪切/粘贴到下面的python示例中代替<auth_token>
:
Then click the "generate access token" button and cut/paste into the python example below in place of <auth_token>
:
这篇关于从 python 脚本上传文件到我的 Dropbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 python 脚本上传文件到我的 Dropbox


- 沿轴计算直方图 2022-01-01
- 使用Heroku上托管的Selenium登录Instagram时,找不到元素';用户名'; 2022-01-01
- 如何在 python3 中将 OrderedDict 转换为常规字典 2022-01-01
- pytorch 中的自适应池是如何工作的? 2022-07-12
- 如何在 Python 的元组列表中对每个元组中的第一个值求和? 2022-01-01
- python check_output 失败,退出状态为 1,但 Popen 适用于相同的命令 2022-01-01
- python-m http.server 443--使用SSL? 2022-01-01
- 分析异常:路径不存在:dbfs:/databricks/python/lib/python3.7/site-packages/sampleFolder/data; 2022-01-01
- 如何将一个类的函数分成多个文件? 2022-01-01
- padding='same' 转换为 PyTorch padding=# 2022-01-01