我寫了一個JavaScript方法來在Google Drive中創建文件夾。使用JavaScript API在Google Drive中創建文件夾
function createFolder(){
data = new Object();
data.title = 'New Folder';
data.parents = [{"id":jQuery('#parent').val()}];
data.mimeType = "application/vnd.google-apps.folder";
gapi.client.drive.files.insert(data).execute(function(fileList){});
}
它創建一個名爲「無標題」與mime類型的「application /八位字節流」和父根目錄文件。 此代碼應該創建一個名爲「新建文件夾」的文件夾。
是的,它的工作原理!這就是我要的。 (有一個小的語法錯誤;你忘記在「'resource':data」中添加大括號,請更新答案。) –
哇!我從Google團隊得到了答案! –
謝謝,我更新了我的答案。我的團隊和我監控google-drive-sdk標籤,非常樂意提供幫助! :) –