
* Return the text contained in the given csv file. downloadAsFile(fileName) // Have browser download, rather than display append(getCsvFile(fileName)) // Append the text from our csv file createTextOutput() // Create textOutput Object * This function serves content for a script deployed as a web app.

You have no control over that from the server side, where this script runs. Once you've saved a version of the script and published it as a web app, you can direct a browser to the published URL to start a download.ĭepending on your browser settings, you may be able to select a specific local folder and/or change the file name. This script will get the text content of a csv file on your Google Drive, and serve it for downloading. Since we have no content, there's nothing to download, so you see, well, nothing. downloadAsFile(fileName) - when a browser invokes our Get service, have it download the content (named fileName) rather than displaying it. createTextOutput() - create an empty text output object, then. Its important to remember that if you have restricted a folder, permission changes only apply to the folder.


Uncheck the permission boxes according to your restrictions. Select the file you want to restrict and right-click on it. ContentService - use Content Service, and. Open Google Drive, or any other Google Drive app.Assuming that it's a one-line body of a doGet() function that you've deployed as a Web App, then here's why you're seeing nothing: The line of code you've shown does nothing on it's own. ContentService is used to serve up text content as a Web Application.
