When a user selects a file and clicks the 'Open with' context menu item,Drive redirects the user to that app's Open URL defined when you Configure aDrive integration.
https://lee-free.mystrikingly.com/blog/genie-wild-slot. If you checked the 'Importing' box when you configured a Drive integration,the user can select a combination of app-specific andGoogle Workspace files toopen. App-specific files are defined in the Default Mime Types and DefaultFile Extensions fields when you configured a Drive integration.Google Workspacefiles are defined in the Secondary Mime Types and Secondary FileExtensions fields when you configured a Drive integration.
For each file that the user wants to open, Drive checks the MIME types againstthe default and secondary mime types you defined:
For MIME types defined in the Default Mime Types field, the fileID ispassed on to your app. For information on how to handle app-specific files,refer to Handle an Open URL for an app-specific document
For MIME types defined in the Secondary Mime Types field, the Drive UIdisplays a dialog asking the user what file type to convert theGoogle Workspace file to. Forexample, if you select a Google Doc in the Drive UI and Secondary Mime Typesfield suggests your app supports text/html, text/plain, or application/pdf,the Drive UI asks the user if they want to convert to HTML, Plain text, or PDF.For information on how to handle Google Workspacefiles, refer toHandle an Open URL for a Google Workspace document.For a listof Google Workspace Documents, conversionformats, and corresponding mime types, refer toGoogle Workspace documents and corresponding export MIME types.
Open The Google Drive App Chrome
Handle an Open URL for an app-specific document
As mentioned in Configure a drive UI integration,your app receives template variables holding information for your app to openthe file. Your app receives a default set of template variableswithin a state
parameter. The default state
information for an app-specificOpen URL is:
To handle this information:
Detect the
open
value in thestate
parameter to verify that this is a request to open a file.Check permissions, fetch file metadata, and download the file content usingthe files.get method.
Learn what takes up space in Google Drive and where to buy more space. Step 1: Open the app. On your Android device, find and open the Google Drive app. In 'My Drive,' you'll see: Files and folders you upload or sync. Google Docs, Sheets, Slides, and Forms you create; Step 2: Upload or create files. You can upload files from your phone. Back up all of your content to the cloud – easily access your files in Google Drive and your photos in Google Photos. Or the negotiated Google Apps terms, if applicable. Safely store and share your photos, videos, files and more in the cloud. Your first 15 GB of storage are free with a Google account.
The state
parameter is URL-encoded, so your app must handle the escapecharacters and parse it as JSON.
Drive works on all major platforms, enabling you to work seamlessly across your browser, mobile device, tablet, and computer. Folder transfer app android. Go to Google Drive Let's get started. Access Google Drive with a free Google account (for personal use) or Google Workspace account (for business use).
Note: All apps, including apps opening files from shortcuts and third-partyshortcuts, should call files.get to check theuser's permissions for a document. Apps should warn read-only users when theyare opening a file they cannot edit or save (instead of letting them spend timeediting, and then giving an error on save).Handle an Open URL for a Google Workspace document
As mentioned in Configure a drive UI integration,your app receives a default set of template variables within a state
parameter. The default state
information for an app-specificOpen URL is:
To handle this information:
Detect the
open
value in thestate
parameter to verify that this is a request to open a file.Check permissions, fetch file metadata, and determine mime type.
Convert the file content using thefiles.export method. The following snippetshows how to convert a file as a new file type.
Display converted files as read-only or present a dialog box allowing theuser to save the file as a file of the new type.
The state
parameter is URL-encoded, so your app must handle the escapecharacters and parse it as JSON.
Next step
In addition to launching an application from Google Drive UI, applications candisplay a file picker to select content from within the app itself. Seethe files picker guide for additional details.
Apps should display converted files as read-only, or let users save them as newfiles.
This section provides samples for the Drive API.
Check out the Drive API video library for links tointroductory videos on using the API.
The samples listed below and indexed in the left navigation menu are hostedon GitHub. You can fork these repositories and use thecode as a reference for your own projects.
Meta Displayer
Open The Google Drive App For Desktop
Meta Displayer is a JavaScript app that uses the file picker to open anddisplay metadata for a file. The example contains working code showing:
- Authorizing an application and authenticating user requestsusing the
drive.file
scope - Using the Drive file picker.
- Using
files.get
to get additionalfields for a file.
To view or download the source, visit theMetadisplayer on the GitHub repo.
ZIP Extractor
ZIP Extractor is a JavaScript implementation of a utility for opening andextracting ZIP files into Google Drive. The example contains working codeshowing:
- Authorizing an application and authenticating user requestsusing the
drive.file
scopesharingwidgets. - Uploading anddownloading files usingCORS
To get started, try the app orinstall it in Drive.To view or download the source, visit theZIP Extractor on the GitHub repo.
- Authorizing an application and authenticating user requestsusing the
drive.file
scope - Using the Drive file picker.
- Using
files.get
to get additionalfields for a file.
To view or download the source, visit theMetadisplayer on the GitHub repo.
ZIP Extractor
ZIP Extractor is a JavaScript implementation of a utility for opening andextracting ZIP files into Google Drive. The example contains working codeshowing:
- Authorizing an application and authenticating user requestsusing the
drive.file
scopesharingwidgets. - Uploading anddownloading files usingCORS
To get started, try the app orinstall it in Drive.To view or download the source, visit theZIP Extractor on the GitHub repo.
QuickEditor
Each of the Google Drive platform-specific examples reflects a singlesample app: a text editor capable ofediting Google Drive files with the MIME type text/*
.The web versionimplements two fundamental Google Drive use cases:
The flow for both use cases is similar. Slot machine hack device. Google Drive redirects a user to theapp after the user selects it from the Create menu or context menu of afile with a registered MIME type.
To view or download the source, visit the QuickEditor on the GitHub repo.