File size: 436 Bytes
a746d34
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
class ImageSaver {
  /**
   * Saves an image to Google Drive.
   * @param {String} imageData The URL of the image data.
   */
  saveImage(imageData) {
    var response = UrlFetchApp.fetch(imageData);
    var blob = response.getBlob();
    var folder = DriveApp.getFolderById('YOUR_FOLDER_ID'); // Replace with your folder ID
    var file = folder.createFile(blob);
    Logger.log('Image saved to Google Drive: %s', file.getUrl());
  }
}