【问题标题】:Create new Google Drive file with text content (javascript)使用文本内容创建新的 Google Drive 文件 (javascript)
【发布时间】:2012-08-14 12:20:25
【问题描述】:

我可以使用 javascript Google API 来验证我的 web 应用程序并在 Google Drive 中创建新文件,正如 in this post 所解释的那样:

function createNewFile() {
    gapi.client.load('drive', 'v2', function() {
        var request = gapi.client.request({
            'path': '/drive/v2/files',
            'method': 'POST',
            'body':{
                "title" : "test.txt",
                "description" : "Some"
            }
        });
        request.execute(function(resp) { console.log(resp); });
    });
}

它会在云端硬盘中创建一个空文件。但我不知道如何通过向其添加文本内容(例如“blablabla”)来创建新的非空文件。有人可以帮我吗?

【问题讨论】:

  • 在这个answer 获得战利品。

标签: javascript google-drive-api google-drive-realtime-api


【解决方案1】:

查看我为在插入How do I add/create/insert files to Google Drive through the API?后更新文件所做的更新功能

阅读页面上的主要答案,这也提示在一次调用 API 中创建/插入。

【讨论】:

    猜你喜欢
    • 2019-01-17
    • 1970-01-01
    • 2012-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多