This sample function will extract your zip file and put it in your Google Drive in the "StackOverflow" folder. You can also download a more complete version from this value .
function getFile(fileURL) { // see https://developers.google.com/apps-script/class_urlfetchapp var response = UrlFetchApp.fetch(fileURL); var fileBlob = response.getBlob() var folder = DocsList.getFolder('StackOverflow'); var result = folder.createFile(fileBlob); debugger; // Stop to observe if in debugger }
For instance:
getFile( "http://mysite.com/files/file.val1.val22.zip" );
Please note that you cannot load by itself, since you do not have access to the resources of your computer (for example, the file system) from applications - a script. The file is still in the cloud ... in this case, it was copied from the website on which it was included into Google Drive. However, if you use the Drive application, the file will now be synchronized with your PC.
source share