1

I have created one app in Appmaker, I want to download certain reports from the Drive tables in Appmaker. For this currently I am creating SpreadSheet using Drive APIs. I want to add download feature as well which allows users to Download Spreadsheet in their local machine.

I have done research on Appscript which allows users to Download files using ContentService, however I do not have any HTMl page from where I can invoke this method. Are there any alternatives for this?

Darpan Sanghavi
  • 1,443
  • 2
  • 17
  • 32

1 Answers1

0

It seems that you can get download URL using DriveApp Apps Script service

// Server script
var downloadUrl = DriveApp.getFileById(FileIdGoesHere).getDownloadUrl();
Pavel Shkleinik
  • 6,298
  • 2
  • 24
  • 36
  • I am getting `null` value in `downloadUrl` . – Darpan Sanghavi Apr 26 '18 at 10:44
  • Are you getting `null` for all files types? I think it is expected behavior for files that are not actually files. Spreadsheets for example. If you go to `File -> Download` in spreadsheet it will offer to you to select export file format (xlsx, pdf, csv, etc...). So, most likely you are looking for https://stackoverflow.com/questions/11619805/ or for https://developers.google.com/drive/v3/web/manage-downloads#downloading_google_documents (aka https://developers.google.com/apps-script/advanced/drive) – Pavel Shkleinik Apr 26 '18 at 21:56