

I have another question to answer for Rebecca. Var dest = fs.createWriteStream('/tmp/photo.jpg') Ĭonsole.G'day there, Peter Moriarty here.

var fileId = '0BwwA4oUTeiV1UVNwOHItT0xfa2M' This is the simple use case for downloading a file in Node.js, but you have examples also for Python and Java.

Google has specific guides for Download files, this includes Download a general file from Google Drive and Download Google Workspace Document, and for search for a specific file, via name = my_server_side_generated_file or mimeType = 'application/epub+zip', or whatever query method you want to use. The steps are easy, look for the file, grab the ID and download to your machine.

Please suggest a way to download the drive file to the 'Downloads' folder in local machine or download the server file directly into the local machine without saving it in the drive.Īs long as Apps Script is server side executed, there is no direct way to use it to download to your machine.īut, as you have your file is in your Drive, what about using one of the client libraries for Google APIs, in your case Drive API, to download it directly to your machine? This is my code for retrieving the file from our server, download it to the drive. inddįound this article, but it is only for downloading text content. The downloading file will be in below formats. Searched for ways to do it with the Drive api. I have currently implemented to download that file into the Google Drive, now looking for a way to download it to the local machine. So trying to download it first into the drive, then download the drive file into the local machine. Didn't found a way to download that file directly into the local machine. I need to modify my Apps Script Google Docs add-on project to download a file generated in our server (authentication needed) to the local machine.
