Create new file in a folder with Apps Script using Google Advanced Drive service

后端 未结 6 1695
天命终不由人
天命终不由人 2021-02-04 06:23

There are four ways to create a new file:

  • DocsList - Shown as DocsList in the Main List. Built in to Apps Script.
  • DriveApp - Shown as
6条回答
  •  盖世英雄少女心
    2021-02-04 06:57

    I was able to use the DriveApp to create a file in a specified folder this way.

    var driveFolder = DriveApp.getFolderByName("MyDriveFolder");
    var file = driveFolder.createFile(formObject.txtReceipt);
    file.setName("MyFile");    
    

    PS: formObject.txtReceipt is coming from a file upload control on a form in the html and this returns a blob

提交回复
热议问题