3

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

Rubén
  • 34,714
  • 9
  • 70
  • 166
Yasser
  • 315
  • 2
  • 10
  • 15
  • 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 Answers1

-1

You might want to try using Content Service:

When a script is published as a web app, the special callback functions doGet() and doPost() 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 to GET and POST 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.

Community
  • 1
  • 1
Mr.Rebot
  • 6,703
  • 2
  • 16
  • 91