-2

I'm building a automation test script and I want to overcome the authentication process so that the script doesn't need manual intervention of Tokens getting added during the execution.

I need the step by step process for downloading images from Google drive using the service account via Node.js. Any help would be much appreciated.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449

1 Answers1

0

Have you checked the documentation? manage downloads

var fileId = '0BwwA4oUTeiV1UVNwOHItT0xfa2M';
var dest = fs.createWriteStream('/tmp/photo.jpg');
drive.files.get({
  fileId: fileId,
  alt: 'media'
})
    .on('end', function () {
      console.log('Done');
    })
    .on('error', function (err) {
      console.log('Error during download', err);
    })
    .pipe(dest);
Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449