I have the script that download my spreadsheet, but it just save it to google drive. Can anybody help me to know how to download it to my local folder on my PC?? Thanks
-
Possible duplicate of [Download "automatically" spreadsheet as .xlsx to local machine on event](https://stackoverflow.com/questions/37212135/download-automatically-spreadsheet-as-xlsx-to-local-machine-on-event) – Rubén Oct 16 '17 at 23:34
1 Answers
You might want to try using Content Service:
When a script is published as a web app, the special callback functions
doGet()
anddoPost()
are invoked whenever a request is made to the script's URL. Instead of returning a user interface object created with the HTML service, the Content service can be used to return raw textual content. This allows you to write scripts that act as "services", responding toGET
andPOST
requests and serving data of various MIME types.
There you can trigger a download and even set the file name via the TextOutput.downloadAsFile method.
Try checking the related SO post : Download file from Google Drive to local folder from Google Apps Script and Google App Script ContentService downloadAsFile not working.
Hope this info helps.