How to download created csv file using Google Apps Script?

前端 未结 3 803
天涯浪人
天涯浪人 2021-01-13 00:29

I\'ve created a file in Google Apps Script as follows

DocsList.createFile(
   \"test.csv\", 
   \"Row1Col1,Row1Col2 \\r\\n Row2Col1,RowCol2 \\r\\n Row3Col1,R         


        
3条回答
  •  独厮守ぢ
    2021-01-13 00:40

    Try using ContentService, you can trigger a download and even set the file name via the TextOutput.downloadAsFile method. You can also set the content mime type of the returned data, though only to a predefined enum constant. See their examples.

提交回复
热议问题