这个问题以前有人问过,但答案是使用 API V2。google 文档没有说明如何使用 javascript 客户端代码创建包含其内容的文件。我尝试使用 Node 下列出的代码,但是,它只创建文件,不插入任何内容。这是我的代码:
let fileMetadata = {
'name': name,
parents: [parentId]
};
let media = {
mimeType: 'text/plain',
body: 'content inside file'
};
gapi.client.drive.files.create({
resource: fileMetadata,
media,
fields: 'id'
})
.then(response => {
console.log('response: ', response);
})
.catch(() => {
console.log('something is wrong');
});
Run Code Online (Sandbox Code Playgroud)
有人可以帮我将内容插入文件吗?
每当我编写命令git branch -a以在本地和远程查看我的所有分支时,我都会以某种方式看到已合并和关闭的旧分支。如何摆脱本地 git 或 github 中不再存在的这些分支?