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.
Files in the
appDataFolder
cannot move between storage locations (spaces). For
more information, see
File organization
.
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
API-specific
authorization and authentication
information
. For more information about
specific OAuth 2.0 scopes, see
OAuth 2.0 Scopes for Google
APIs
.
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 code
sample shows how to insert a file into a folder using a client library.
For further information on creating files in folders, refer to
Create &
populate folders
.
Search for files in the application data folder
To search for files in the application data folder, set the
spaces
field to
appDataFolder
and use the
files.list
method. The following code sample shows how to use search for files in the
application data folder using a client library.
Download files from the application data folder
To download a file from the application data folder, use the
files.get
method. For more information, and to view
code samples, go to
Download blob file
content
.