ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV, WEBDEV and WINDEV Mobile 2024 feature!
Help / WLanguage / WLanguage functions / Communication / Drive functions
  • Properties specific to GglFile variables
  • Possible export formats for Google Docs files (mimeTypeGglDocs constant)
  • Possible export formats for Google Docs files (mimeTypeGglDocs constant)
  • Possible export formats for Google Slides files (mimeTypeGglSlides constant)
  • Possible export formats for Google Drawings files (mimeTypeGglDrawings constant)
  • Possible export formats for Apps Scripts files (mimeTypeGglAppsScript constant)
  • Functions that use the GglFile type
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The GglFile type is used to get all the characteristics of a file used in one of the Google Docs Editors (Docs, Sheets, etc.). These files can only be stored and edited on Google Drive. This drive is handled using a variable of type gglDrive.
CAUTION: Variables of type GglFile can only be created and initialized with DriveListFileGgl.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
oOAuth2Param is OAuth2Parameters
oOAuth2Param.ClientID = "client_id"
oOAuth2Param.ClientSecret = "client_secret"
oOAuth2Param.RedirectionURL = "http://localhost:9000/"

gglMyDrive is gglDrive
gglMyDrive = GglDriveConnect(oOAuth2Param) 

arrGglFile is array of GglFile
arrGglFile = DriveListFileGgl(gglMyDrive, "/", frRecursive)

FOR EACH Queue OF arrGglFile
SWITCH Queue.MimeType
CASE mimeTypeGglDocs: Queue.ExportMimeType = mimeTypeDOCX
CASE mimeTypeGglSheets: Queue.ExportMimeType = mimeTypeXLSX
OTHER CASE: Queue.ExportMimeType = mimeTypePDF
END 
let ResDownload = DriveDownloadGglFile(gglMyDrive, arrGglFile[1], "c:\MyDocuments")
IF ErrorOccurred THEN
// Error handling
Trace ("An error has occurred")
RETURN
END
END
Properties

Properties specific to GglFile variables

The following properties can be used to manipulate Google files:
Property nameType usedEffect
PathCharacter stringPath to the file on the drive.
This property is read-only.
ExportMimeTypeCharacter String constantMime type corresponding to the different export possibilities according to the document type (see Remarks).
MimeTypeCharacter String constantMime type of the Google file:
  • mimeTypeGglAppsScript: Apps Script.
  • mimeTypeGglDrawings: Google Drawings.
  • mimeTypeGglDocs: Google Docs.
  • mimeTypeGglSheets: Google Sheets.
  • mimeTypeGglSlides: Google Slides.
This property is read-only.
NameCharacter stringName of the file on the drive.
This property is read-only.
Remarks

Possible export formats for Google Docs files (mimeTypeGglDocs constant)

Exported file typeConstant (MimeType)Exported file extension
Microsoft WordmimeTypeDOCX.docx
OpenDocumentmimeTypeODT.odt
Rich textmimeTypeRichTextRTF
PDFmimeTypePDF.pdf
Plain textmimeTypeText.txt
Web page (HTML)mimeTypeZIP.zip

Possible export formats for Google Docs files (mimeTypeGglDocs constant)

Exported file typeConstant (MimeType)Exported file extension
Microsoft ExcelmimeTypeXLSX.xlsx
OpenDocumentmimeTypeODS.ods
PDFmimeTypePDF.pdf
Web page (HTML)mimeTypeZIP.zip
Comma-separated values (first sheet only)mimeTypeCSV.csv
Tab-separated values (first sheet only)mimeTypeTSV.tsv

Possible export formats for Google Slides files (mimeTypeGglSlides constant)

Exported file typeConstant (MimeType)Exported file extension
Microsoft PowerPointmimeTypePPTX.pptx
ODPmimeTypeODP.odp
PDFmimeTypePDF.pdf
Plain textmimeTypeText.txt
JPEG (first slide only)mimeTypeJPG.jpg
PNG (first slide only)mimeTypePNG.png
Scalable Vector Graphics (first slide only) mimeTypeSVG.svg

Possible export formats for Google Drawings files (mimeTypeGglDrawings constant)

Exported file typeConstant (MimeType)Exported file extension
PDFmimeTypePDF.pdf
JPEGmimeTypeJPEG.jpg
PNGmimeTypePNG.png
Scalable Vector Graphics mimeTypeSVG.svg

Possible export formats for Apps Scripts files (mimeTypeGglAppsScript constant)

Exported file typeConstant (MimeType)Exported file extension
JsonmimeTypeJSON.json

Functions that use the GglFile type

The following functions are used to handle GglFile variables:
New in version 2024
DriveCopyFile
Copies a single file on a remote drive to another directory on same drive.
New in version 2024
DriveDeleteFile
Deletes a file from a remote drive.
New in version 2024
DriveDownloadGglFile
Downloads a Google Docs Editors file from Google Drive in a given compatible format.
New in version 2024
DriveListFileGgl
Lists Google Docs Editors files (Docs, Sheets, etc.) present on Google Drive.
New in version 2024
DriveMoveFile
Moves a file on a remote drive from one directory to another.
New in version 2024
DriveRename
Renames a file or directory on a remote drive.
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/10/2024

Send a report | Local help