|
|
|
|
- Authenticating to a drive using an OAuth2Parameters variable (recommended)
- Authenticating to a drive using an AuthToken variable
- Functions that use Drive variables
Drive (Variable type) In french: Drive
The Drive type is used to handle online storage services. To use a Drive variable, you need to connect to the desired service using one of the following functions: Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
oOAuth2Param is OAuth2Parameters
oOAuth2Param.ClientID = "client_id"
oOAuth2Param.ClientSecret = "client_secret"
oOAuth2Param.RedirectionURL = "http://localhost:9000/"
oDrive is Drive
oDrive = oDriveConnect(oOAuth2Param)
oMyOAuthParameters is OAuth2Parameters
oOAuth2Token is AuthToken
oOAuth2Token = AuthIdentify(oMyOAuthParameters)
oDrive is Drive
oDrive = GglDriveConnect(oOAuth2Token)
oDrive = oDriveConnect(oOAuth2Token)
oDrive = dpDriveConnect(oOAuth2Token)
Remarks Authenticating to a drive using an OAuth2Parameters variable (recommended) To connect to a drive using the OAuth 2.0 standard, you need to: - Declare a variable of type OAuth2Parameters.
- Specify the ClientID and ClientSecret properties. These properties are mandatory.
The key and secret code are provided when you create a Google application. These details can also be found in the drive developer console. - Specify the RedirectionURL property (optional but recommended). The redirection URL ('redirect_uri', 'callback URL' or 'site URL') depends on the value specified in the application settings defined on the service provider's website. The URL must exist and the values must match.
- Declare a Drive variable.
- Use one of the functions to connect to the desired storage service. The OAuth2Parameters variable is then passed as a parameter to the connection function.
Example:
oOAuth2Param is OAuth2Parameters
oOAuth2Param.ClientID = "client_id"
oOAuth2Param.ClientSecret = "client_secret"
oOAuth2Param.RedirectionURL = "http://localhost:9000/"
oDrive is Drive
oDrive = GglDriveConnect(oOAuth2Param)
Authenticating to a drive using an AuthToken variable If your application uses several services from the same provider (mail, drive, etc.), it may be advisable to keep the same tokens for all services. In this case, you can use an AuthToken variable. To connect to a drive using an AuthToken variable, you need to: - Declare a variable of type OAuth2Parameters. This variable contains all the information needed to authenticate to a service that uses OAuth 2.0.
- Declare a variable of type AuthToken and initialize it with AuthIdentify.
- Declare a Drive variable.
- Use one of the functions to connect to the desired storage service. The AuthToken variable is then passed as a parameter to the connection function.
Example:
oMyOAuthParameters is OAuth2Parameters
oOAuth2Token is AuthToken
oOAuth2Token = AuthIdentify(oMyOAuthParameters)
oDrive is Drive
oDrive = GglDriveConnect(oOAuth2Token)
Functions that use Drive variables The following functions are used to handle Drive variables:
| | | Creates a connection to Dropbox. | | Copies a directory on a remote drive to another directory. | | Copies a single file on a remote drive to another directory on same drive. | | Creates a directory on the remote drive. | | Creates a file on the remote drive. | | Deletes a directory and its files from a remote drive. | | Deletes a file from a remote drive. | | Downloads a directory and its files from a remote drive to the user's computer. | | Downloads a file from a remote drive to the user's computer. | | Lists drive directories. | | Lists the files in a cloud-based drive directory. | | Moves a directory and its contents to another directory within a remote drive. | | Moves a file on a remote drive from one directory to another. | | Renames a file or directory on a remote drive. | | Uploads a directory and its contents to a remote drive. | | Uploads a local file to a remote drive. | | Creates a connection to Google Drive. | | Creates a connection to OneDrive. |
Related Examples:
|
Unit examples (WINDEV): Drive functions
[ + ] This example illustrates the use of Drive functions (Google Drive, Dropbox, OneDrive).
|
|
Unit examples (WINDEV Mobile): Drive functions
[ + ] This example illustrates the use of Drive functions (Google Drive, Dropbox, OneDrive).
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|