将现有的云端硬盘文件复制到appdata文件夹中 [英] Copy an existing Drive file into the appdata folder
问题描述
我正在尝试使用Drive SDK中新的 Application Data 文件夹,而不是使用创建一个新文件,如示例代码所示,我希望创建一个用户选择的模板文件的副本.我的模板文件是保存在特定云端硬盘帐户中的Google可编辑电子表格,并且可以在世界范围内读取,并且其ID在我的应用程序中配置.
I am attempting to use the new Application Data folder in the Drive SDK, but rather than creating a new file as the sample code shows, I wish to create a copy of a template file which the user selects. My template files are Google-editable spreadsheets held within a specific Drive account and are world-readable, with their IDs configured in my application.
我首先通过在
这会导致文本出现403错误 this produced a 403 error with the text appdata文件夹中仅允许包含内容存储在云端硬盘中的文件夹或文件 Only folders or files with content stored in Drive are allowed within the appdata folder 所以我尝试将 So I tried adding 这再次失败并显示403,但错误略有不同 This fails again with a 403, but a slightly different error appdata内容不支持该方法 Method not supported for appdata contents 我还尝试在创建后更新新文件的 I have also tried updating the 所以我的问题是,是否可以在用户的appdata文件夹中创建云端硬盘中现有字段的副本?始终失败的事实并不说明这一点,我可能不得不使用用户的普通存储,但是如果可能的话,我想使用appdata文件夹将我的应用内容与其常规的云端硬盘文件分开. So my question is, is it possible to create a copy of an existing field held in Drive, within a user's appdata folder? The fact that this consistently fails suggests not and that I may have to use the user's normal storage, but I would like to use the appdata folder if possible to separate my app's content from their general Drive files. 实际上,很遗憾,您目前无法放置实时文件
在appdata文件夹中.这是我们正在寻找的东西
加上,但是在大多数情况下,这是没有意义的,因为
appdata文件夹仅限于一个用户. Actually, unfortunately you cannot currently place a realtime file
within the appdata folder. This is something we are looking at
adding, but in most cases it doesn't make sense since the content of
the appdata folder is restricted to a single user. Google云端硬盘开发人员上的Cheryl Simon- https://plus.google.com/communities/107264319205603895037 Cheryl Simon on Google Drive Developers - https://plus.google.com/communities/107264319205603895037 这篇关于将现有的云端硬盘文件复制到appdata文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
root
作为第二个父级添加到parents
数组中,如下所示root
as a second parent in the parents
array, as follows{
"title": "New file",
"parents":
[
{
"id": "appdata"
},
{
"id": "root"
}
]
}
parents
属性,并将新值插入到新创建文件的父级实体中,这两者都会产生相同的不支持方法"错误. parents
property of the new file after creation, and by inserting a new value into the parents entity of the newly-created file, both of which yield the same 'Method not supported' error.推荐答案