c# - 是否可以在 google drive api v3 C# 中为文件添加自定义元数据?
问题描述
我有一个要上传到 Google Drive 的文件列表。
是否可以向每个文件添加自定义元数据?
解决方案
是的,这是可能的。
请参阅:https ://developers.google.com/drive/api/v3/properties
您可以在对象上设置properties
和。appProperties
File
“要添加对所有应用程序可见的属性,请使用资源
properties
字段files
。要添加仅限于您的应用程序的属性,请使用资源appProperties
字段files
。”
示例(假设您知道如何使用 contenttype 上传文件流,并且只想对元数据进行解释):
var file = new File
{
Properties = new Dictionary<string, string>
{
{ "CustomTag", "1234" }
}
};
service.Files.Create(file, fileStream, contentType).Execute();
推荐阅读
- vb.net - 在文本文件中搜索特定文本然后阅读整行的最佳方法是什么?(视觉基础)
- python - pymunk - 是否有标准的方法来设置对象的自定义重力?
- php - 上传到 Google 云端硬盘时包含 0 个 mime 部分的无效多部分请求
- java - Web 项目未在 Websphere 9 中启动,但 BValInterceptor 的 CDI 相关异常
- kotlin - Kotlin反射包并获取所有类
- javascript - 如何使用 Twitter API 和来自另一个 js 文件的特定功能发布推文
- java - 验证 API 请求的空数组
- sql-server - 当 ID 多次出现时获取该 ID 的 Min(startdate) 和 Max(enddate)
- excel - 显示与另一个单元格相邻的单元格的值
- reactjs - React Redux 在动作中调用动作并获取返回值