Adds the given file to the root of the user's Drive.
Adds the given file to the root of the user's Drive. This method does not move the file out of its existing parent folder; a file can have more than one parent simultaneously.
Adds the given folder to the root of the user's Drive.
Adds the given folder to the root of the user's Drive. This method does not move the folder out of its existing parent folder; a folder can have more than one parent simultaneously.
Resumes a file iteration using a continuation token from a previous iterator.
Resumes a file iteration using a continuation token from a previous iterator. This method is useful if processing an iterator in one execution would exceed the maximum execution time. Continuation tokens are generally valid for one week.
Resumes a folder iteration using a continuation token from a previous iterator.
Resumes a folder iteration using a continuation token from a previous iterator. This method is useful if processing an iterator in one execution would exceed the maximum execution time. Continuation tokens are generally valid for one week.
Creates a file in the root of the user's Drive with the given name, contents, and MIME type.
Creates a file in the root of the user's Drive with the given name, contents, and MIME type. Throws an exception if content is larger than 10MB.
Creates a text file in the root of the user's Drive with the given name and contents.
Creates a text file in the root of the user's Drive with the given name and contents. Throws an exception if content is larger than 10MB.
Creates a file in the root of the user's Drive from a given Blob of arbitrary data.
Creates a folder in the root of the user's Drive with the given name.
Gets the file with the given ID.
Gets the file with the given ID. Throws a scripting exception if the file does not exist or the user does not have permission to access it.
Gets a collection of all files in the user's Drive.
Gets a collection of all files in the user's Drive that have the given name.
Gets a collection of all files in the user's Drive that have the given MIME type.
Gets the folder with the given ID.
Gets the folder with the given ID. Throws a scripting exception if the folder does not exist or the user does not have permission to access it.
Gets a collection of all folders in the user's Drive.
Gets a collection of all folders in the user's Drive that have the given name.
Gets the folder at the root of the user's Drive.
Gets the number of bytes the user is allowed to store in Drive.
Gets the number of bytes the user is currently storing in Drive.
Gets a collection of all the files in the trash of the user's Drive.
Gets a collection of all the folders in the trash of the user's Drive.
Removes the given file from the root of the user's Drive.
Removes the given file from the root of the user's Drive. This method does not delete the file, but if a file is removed from all of its parents, it cannot be seen in Drive except by searching for it or using the "All items" view.
Removes the given folder from the root of the user's Drive.
Removes the given folder from the root of the user's Drive. This method does not delete the folder or its contents, but if a folder is removed from all of its parents, it cannot be seen in Drive except by searching for it or using the "All items" view.
Gets a collection of all files in the user's Drive that match the given search criteria.
Gets a collection of all files in the user's Drive that match the given search criteria. The search criteria are detailed the Google Drive SDK documentation. Note that the params argument is a query string that may contain string values, so take care to escape quotation marks correctly (for example "title contains 'Gulliver\\'s Travels'" or 'title contains "Gulliver\'s Travels"').
Gets a collection of all folders in the user's Drive that match the given search criteria.
Gets a collection of all folders in the user's Drive that match the given search criteria. The search criteria are detailed the Google Drive SDK documentation. Note that the params argument is a query string that may contain string values, so take care to escape quotation marks correctly (for example "title contains 'Gulliver\\'s Travels'" or 'title contains "Gulliver\'s Travels"').
DriveApp Allows scripts to create, find, and modify files and folders in Google Drive. // Log the name of every file in the user's Drive. var files = DriveApp.getFiles(); while (files.hasNext()) { var file = files.next(); Logger.log(file.getName()); }