The application data folder is a special hidden folder that your app can use to store application-specific data, such as configuration files. The application data folder is automatically created when you attempt to create a file in it. Use this folder to store any files that the user shouldn't directly interact with. This folder is only accessible by your application and its contents are hidden from the user and from other Drive apps.
The application data folder is deleted when a user uninstalls your app from their MyDrive. Users can also delete your app's data folder manually.
Application data folder scope
Before you can access the application data folder, you must request access to
the https://www.googleapis.com/auth/drive.appdata
scope. For more information
about scopes and how to request access to them, refer to
Authenticate your users.
Create a file in the application data folder
To create a file in the application data folder, specify appDataFolder
in the
parents
property of the file and use the
files.create
method to upload the file to
the folder. The following example shows how to insert a file into a folder using
a client library:
Java
Python
Node.js
PHP
.NET
For further information on creating files in folders, refer to Create and populate folders.
Search for files in the application data folder
To search for files in ithe application data folder, set the spaces
field to
appDataFolder
and use the files.list
method. The following example shows how to search for files in the application
data folder using a client library: