简体   繁体   English

从 Dropbox API 下载的文件为 Zip

[英]Files downloaded from Dropbox API come as a Zip

I am trying to download a file from my Dropbox account, however, on Linux (Raspbian) when I execute the line:我正在尝试从我的 Dropbox 帐户下载文件,但是,当我执行以下行时,在 Linux (Raspbian) 上:

dbx = dropbox.Dropbox(TOKEN)
dbx.files_download_to_file(LOCAL_PATH,r'/file.ppsx')

It is downloaded as a zip.它以 zip 的形式下载。 I do not have this problem executing the code on Windows.我在 Windows 上执行代码没有这个问题。 I'd like to note the file is a.ppsx, a PowerPoint presentation file.我想指出该文件是 a.ppsx,一个 PowerPoint 演示文件。 I have no problem downloading it manually from Dropbox.我从 Dropbox 手动下载它没有问题。 My question is, how can I circumvent this problem and download it unzipped?我的问题是,我怎样才能绕过这个问题并下载它解压缩?

It seems that Dropbox sent the file not as a zip, but rather changed the name of the file to the directory of where it was installed.似乎 Dropbox 发送的文件不是 zip,而是将文件名更改为安装目录。 I circumvented this problem by using the os.rename module.我通过使用os.rename模块规避了这个问题。 This solved the problem and allowed me to open the file within the same script.这解决了问题并允许我在同一个脚本中打开文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM