2

我有一个文件夹 ID 和一个应该上传到该 gDrive 文件夹的文件。我尝试了以下方法:

File body = new File();
body.Title = titulo; // titulo is a string that contains the tittle of the file
body.Description = descripcion; // the description, it is a string as well
body.MimeType = setMimetype(rutaArchivo); // and this is a method that sets the mimetype according to the file extension.`

我尝试使用body.Parents但我没有运气,body.parents.add只收到一个字符串(我试图提供包含 gdrive 文件夹 id 的字符串),而且我不太了解parents.Insert.

4

1 回答 1

3

您应该添加一个父引用(您非常接近):

body.Parents = new List<ParentReference>()
      {new ParentReference() {Id = parentId}};

parentId父级的字符串文件 ID在哪里。

于 2013-01-06T01:07:50.037 回答