Google Drive Delphi Component for Delphi 7 - Delphi 10.4.2 Sydney Full Source
Google Drive Delphi Component for Delphi 7 - Delphi 10.4.2 Sydney Full Source
Google Drive Delphi Component is a non-visual component that allows you to work with Google Drive (including Google Team Drives) data using Delphi. The component works directly with the service using official APIs v3 version. Official APIs use guarantees maximum compatibility and fewest possible modifications to future versions.
Features
Create and edit folders
Upload, update and download files in different formats
Move and copy files between folders
Rename and delete files and folders
Work with shared drives /items
Search capabilities
Export of Google documents
Access to XML code for each object with ability to read and modify any fields of an object
Proxy servers support
Examples
Browsing Google Drive and adding items to TreeView.
var
FFileInfo: TGDFileInfo;
CurNode: TTreeNode;
Begin
GoogleDrive := TGoogleDrive.Create;
if GoogleDrive.FindFirst(FFileInfo) = 0 then
repeat
CurNode := FilesTV.Items.AddChildObject(FilesTV.Items.GetFirstNode,
FFileInfo.Title, FFileInfo);
if FFileInfo.IsDir then
CurNode.HasChildren := True;
until GoogleDrive.FindNext(FFileInfo) 0;
End;
FFileInfo: TGDFileInfo;
CurNode: TTreeNode;
Begin
GoogleDrive := TGoogleDrive.Create;
if GoogleDrive.FindFirst(FFileInfo) = 0 then
repeat
CurNode := FilesTV.Items.AddChildObject(FilesTV.Items.GetFirstNode,
FFileInfo.Title, FFileInfo);
if FFileInfo.IsDir then
CurNode.HasChildren := True;
until GoogleDrive.FindNext(FFileInfo) 0;
End;
Uploading "MyDocument.docx" file.
Stream := TFileStream.Create('MyDocument.docx', fmOpenRead);
try
NewFile := GoogleDrive.Upload(Stream, 'MyDocument.docx');
finally
Stream.Free;
end;
try
NewFile := GoogleDrive.Upload(Stream, 'MyDocument.docx');
finally
Stream.Free;
end;
Deleting file Obj.
GoogleDrive.Delete(Obj);
Compiled demo