GoogleDrive Class
Properties Methods Events Configuration Settings Errors
The GDrive component provides easy file and folder management.
Class Name
InCloudStorage_GoogleDrive
Procedural Interface
incloudstorage_googledrive_open(); incloudstorage_googledrive_close($res); incloudstorage_googledrive_register_callback($res, $id, $function); incloudstorage_googledrive_get_last_error($res); incloudstorage_googledrive_get_last_error_code($res); incloudstorage_googledrive_set($res, $id, $index, $value); incloudstorage_googledrive_get($res, $id, $index); incloudstorage_googledrive_do_addchild($res, $childid); incloudstorage_googledrive_do_addparent($res, $parentid); incloudstorage_googledrive_do_addpermission($res); incloudstorage_googledrive_do_addqueryparam($res, $name, $value); incloudstorage_googledrive_do_config($res, $configurationstring); incloudstorage_googledrive_do_copyresource($res, $resourcetitle); incloudstorage_googledrive_do_createfolder($res, $foldertitle); incloudstorage_googledrive_do_deletechild($res, $childid); incloudstorage_googledrive_do_deleteparent($res, $parentid); incloudstorage_googledrive_do_deletepermission($res); incloudstorage_googledrive_do_deleteresource($res); incloudstorage_googledrive_do_downloadfile($res, $fileformat); incloudstorage_googledrive_do_getresourceinfo($res); incloudstorage_googledrive_do_getuploadstatus($res); incloudstorage_googledrive_do_interrupt($res); incloudstorage_googledrive_do_listchanges($res, $startchangeid); incloudstorage_googledrive_do_listchildren($res); incloudstorage_googledrive_do_listparents($res); incloudstorage_googledrive_do_listpermissions($res); incloudstorage_googledrive_do_listresources($res); incloudstorage_googledrive_do_movetotrash($res); incloudstorage_googledrive_do_restorefromtrash($res); incloudstorage_googledrive_do_updatepermission($res); incloudstorage_googledrive_do_updateresource($res); incloudstorage_googledrive_do_uploadfile($res, $filetitle);
Remarks
GDrive allows quick and simple management of files and folders stored in Google Drive.
To upload a file, simply call UploadFile and specify the file you wish to upload. To list files and folders, call ListResources. Resources are described by the Resource* properties. Setting ResourceIndex selects a specific resource and allows you to inspect the related properties.
Call DownloadFile to download a file. Other file and folder management functions include CreateFolder, CopyResource, DeleteResource, MoveToTrash, RestoreFromTrash, UpdateResource, and more.
In addition you can modify permissions and child-parent relationships. Please see the Methods section of the documentation for a full list of supported methods.
This service supports authentication via OAuth 2.0. First, perform OAuth authentication using the OAuth class or
a separate process. Once complete you should have an authorization string which looks like:
Bearer ya29.AHES6ZSZEJzATdZYjeihDn5W-VrXSsxEZu5p0pclxGdKKQ
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
Authorization | OAuth 2.0 Authorization Token. |
ChangeMarker | A marker when changes are paged. |
ChangeCount | The number of records in the Change arrays. |
ChangeDeleted | Whether the file is deleted. |
ChangeId | The Id of the change. |
ChangeResourceId | The Id of the file to which the change applies. |
ChildMarker | A marker when children are paged. |
ConvertDocument | Whether to convert a document when uploading. |
CookieCount | The number of records in the Cookie arrays. |
CookieDomain | The domain of a received cookie. |
CookieExpiration | This property contains an expiration time for the cookie (if provided by the server). |
CookieName | The name of the cookie. |
CookiePath | This property contains a path name to limit the cookie to (if provided by the server). |
CookieSecure | This property contains the security flag of the received cookie. |
CookieValue | This property contains the value of the cookie. |
EncryptionAlgorithm | The encryption algorithm. |
EncryptionPassword | The encryption password. |
FirewallAutoDetect | This property tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallType | This property determines the type of firewall to connect through. |
FirewallHost | This property contains the name or IP address of firewall (optional). |
FirewallPassword | This property contains a password if authentication is to be used when connecting through the firewall. |
FirewallPort | This property contains the TCP port for the firewall Host . |
FirewallUser | This property contains a user name if authentication is to be used connecting through a firewall. |
Idle | The current status of the component. |
LocalFile | The location of the local file. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
OtherHeaders | Other headers as determined by the user (optional). |
Overwrite | Determines if local files are overwritten. |
ParsedHeaderCount | The number of records in the ParsedHeader arrays. |
ParsedHeaderField | This property contains the name of the HTTP header (same case as it is delivered). |
ParsedHeaderValue | This property contains the header contents. |
PermissionAdditionalRoles | Additional roles. |
PermissionCount | The number of permissions for the file. |
PermissionETag | The ETag of the permission. |
PermissionId | The Id of the permission. |
PermissionIndex | Specifies the permission. |
PermissionMarker | A marker when permissions are paged. |
PermissionRole | The role specified for the permission. |
PermissionType | The type entity to which the permission applies. |
PermissionValue | The value for the permission type. |
ProxyAuthScheme | This property is used to tell the component which type of authorization to perform when connecting to the proxy. |
ProxyAutoDetect | This property tells the component whether or not to automatically detect and use proxy system settings, if available. |
ProxyPassword | This property contains a password if authentication is to be used for the proxy. |
ProxyPort | This property contains the TCP port for the proxy Server (default 80). |
ProxyServer | If a proxy Server is given, then the HTTP request is sent to the proxy instead of the server otherwise specified. |
ProxySSL | This property determines when to use SSL for the connection to the proxy. |
ProxyUser | This property contains a user name, if authentication is to be used for the proxy. |
QueryParamsCount | The number of records in the QueryParams arrays. |
QueryParamsName | This property contains the name of the parameter to be used in a Query request. |
QueryParamsValue | This property contains the value of the parameter to be used in a Query request. |
ResourceChildCount | The number of records in the ResourceChild arrays. |
ResourceChildId | The Id of the child file or folder. |
ResourceChildLink | The Link of the child resource. |
ResourceCount | The number of files and folders. |
ResourceCreatedDate | The creation date of the file or folder. |
ResourceData | Holds the file data after downloading or sets the file data before uploading or updating. |
ResourceDescription | A short description of the file or folder. |
ResourceETag | The ETag of the resource. |
ResourceExtension | The extension of the file. |
ResourceFormats | A comma separated list of file formats. |
ResourceId | The Id of the resource. |
ResourceIndex | Selects the file or folder. |
ResourceMarker | A marker when resources are paged. |
ResourceMD5Checksum | The MD5 checksum of the file. |
ResourceMIMEType | The MIME type of the file. |
ResourceModifiedDate | The modified date of the resource. |
ResourceOriginalName | The original name of the file. |
ResourceOwners | A comma separated list of owners. |
ResourceParentCount | The number of records in the ResourceParent arrays. |
ResourceParentId | The Id of the parent folder. |
ResourceParentRoot | Whether the parent folder is the root folder. |
ResourceRestricted | Whether the file is restricted. |
ResourceSize | The size of the file in bytes. |
ResourceStarred | Whether the resource is starred. |
ResourceTitle | The title of the file or folder. |
ResourceTrashed | Whether the resource is in the trash. |
ResourceType | Indicates whether the current entry is a folder or a file. |
ResourceViewed | Whether the resource has been viewed. |
ResumeURL | The URL for the resumable upload. |
SSLAcceptServerCertEncoded | The certificate (PEM/base64 encoded). |
SSLCertEncoded | The certificate (PEM/base64 encoded). |
SSLCertStore | The name of the certificate store for the client certificate. |
SSLCertStorePassword | If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store. |
SSLCertStoreType | The type of certificate store for this certificate. |
SSLCertSubject | The subject of the certificate used for client authentication. |
SSLServerCertEncoded | The certificate (PEM/base64 encoded). |
StartByte | The byte offset from which to start the upload or download. |
Timeout | A timeout for the component. |
UseResumableUpload | Whether to use resumable uploads. |
XChildrenCount | The number of records in the XChild arrays. |
XChildName | The Name property provides the local name of the element. |
XChildXText | This property contains the inner text of the element. |
XElement | The name of the current element. |
XParent | The parent of the current element. |
XPath | Provides a way to point to a specific element in the response. |
XSubTree | A snapshot of the current element in the document. |
XText | The text of the current element. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
AddChild | Adds a child file or folder to a parent folder. |
AddParent | Adds a parent folder for a file or folder. |
AddPermission | Adds a permission to the specified file or folder. |
AddQueryParam | Adds a query parameter to the QueryParams properties. |
Config | Sets or retrieves a configuration setting . |
CopyResource | Copies a file. |
CreateFolder | This method creates a new folder. |
DeleteChild | Deletes a child from a folder. |
DeleteParent | Deletes the parent from a file or folder. |
DeletePermission | Deletes the specified permission. |
DeleteResource | Deletes the specified file or folder. |
DownloadFile | Downloads the currently selected file. |
GetResourceInfo | This method retrieves information about the file. |
GetUploadStatus | Get the status of a resumable upload session. |
Interrupt | Interrupt the current method. |
ListChanges | Lists changes for a user. |
ListChildren | Lists children of the current folder. |
ListParents | Lists the current file or folder parents. |
ListPermissions | Lists the permissions for the specified file or folder. |
ListResources | Lists the files and folders for the current user. |
MoveToTrash | Moves the selected file or folder to the trash. |
RestoreFromTrash | Restores a file or folder from trash. |
UpdatePermission | Update the permissions on a file or folder. |
UpdateResource | Updates a file or folder. |
UploadFile | Uploads a new file. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
ChangeList | This event fires once for each change when ListChanges is called. |
ChildList | Fires once for each child when calling ListChildren. |
Connected | Fired immediately after a connection completes (or fails). |
Disconnected | Fired when a connection is closed. |
EndTransfer | Fired when a document finishes transferring. |
Error | Information about errors during data delivery. |
FragmentComplete | This event fires after each fragment of a resumable upload is completed. |
Header | Fired every time a header line comes in. |
ParentList | This event fires once for each parent returned when calling ListParents. |
PermissionList | This event fires once for each permission returned when calling ListPermissions. |
ResourceList | Fires once for each resource when ListResources is called. |
SetCookie | Fired for every cookie set by the server. |
SSLServerAuthentication | Fired after the server presents its certificate to the client. |
SSLStatus | Shows the progress of the secure connection. |
StartTransfer | Fired when a document starts transferring (after the headers). |
Status | Fired when the HTTP status line is received from the server. |
Transfer | Fired while a document transfers (delivers document). |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
PermissionName | The name of the permission. |
PermissionAuthKey | The auth key of the permission. |
IncludeFiles | Whether files are included when calling ListResources. |
IncludeFolders | Whether folders are included when calling ListResources. |
IncludeFolderProperties | Whether Resource properties apply when calling CreateFolder. |
ListOnlyRootItems | Whether to list only resources in the root folder. |
MaxResults | Limits the number of results. |
EncryptionIV | The initialization vector to be used for encryption/decryption. |
EncryptionKey | The key to use during encryption/decryption. |
FragmentSize | The fragment size. |
DownloadTempFile | The temporary file used when downloading encrypted data. |
TempPath | The path to the directory where temporary files are created. |
AcceptEncoding | Used to tell the server which types of content encodings the client supports. |
AllowHTTPCompression | This property enables HTTP compression for receiving data. |
AllowIdenticalRedirectURL | Allow redirects to the same URL. |
Append | Whether to append data to LocalFile. |
Authorization | The Authorization string to be sent to the server. |
BytesTransferred | Contains the number of bytes transferred in the response data. |
EncodeURL | If set to true the URL will be encoded by the component. |
FollowRedirects | Determines what happens when the server issues a redirect. |
GetOn302Redirect | If set to true the component will perform a GET on the new location. |
HTTPVersion | The version of HTTP used by the component. |
IfModifiedSince | A date determining the maximum age of the desired document. |
KeepAlive | Determines whether the HTTP connection is closed after completion of the request. |
MaxRedirectAttempts | Limits the number of redirects that are followed in a request. |
OtherHeaders | Other headers as determined by the user (optional). |
ProxyAuthorization | The authorization string to be sent to the proxy server. |
ProxyAuthScheme | The authorization scheme to be used for the proxy. |
ProxyPassword | A password if authentication is to be used for the proxy. |
ProxyPort | Port for the proxy server (default 80). |
ProxyServer | Name or IP address of a proxy server (optional). |
ProxyUser | A user name if authentication is to be used for the proxy. |
TransferredDataLimit | The maximum number of incoming bytes to be stored by the component. |
TransferredHeaders | The full set of headers as received from the server. |
UseChunkedEncoding | Enables or Disables HTTP chunked encoding for transfers. |
ChunkSize | Specifies the chunk size in bytes when using chunked encoding. |
UserAgent | Information about the user agent (browser). |
KerberosSPN | The Service Principal Name for the Kerberos Domain Controller. |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The TCP port in the local host where the component binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
RecordLength | The length of received data records. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
UseIPv6 | Whether to use IPv6. |
TcpNoDelay | Whether or not to delay when sending packets. |
ReuseSSLSession | Determines if the SSL session is reused. |
SSLCipherStrength | The minimum cipher strength used for bulk encryption. |
SSLEnabledProtocols | Used to enable/disable the supported security protocols. |
SSLProvider | The name of the security provider to use. |
SSLSecurityFlags | Flags that control certificate verification. |
OpenSSLCADir | The path to a directory containing CA certificates. |
OpenSSLCAFile | Name of the file containing the list of CA's trusted by your application. |
OpenSSLCipherList | A string that controls the ciphers to be used by SSL. |
OpenSSLPrngSeedData | The data to seed the pseudo random number generator (PRNG). |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
CodePage | The system code page used for Unicode to Multibyte translations. |