This simple apps script can get an image from the web , save it and return the URL from Google Drive.
1 2 3 4 5 6 7 8 9 | imageUrl = 'http://0.gravatar.com/avatar/24617651310fd4e77c246f8e96efb900' function fetchImageToDrive(imageUrl){ //Fetch image blob var imageBlob = UrlFetchApp.fetch(imageUrl).getBlob(); //Create image file in drive var image = DriveApp.createFile(imageBlob); //return the URL of the newly created image in drive return image.getUrl(); } |