Discuss this help topic in SecureBlackbox Forum

Clouds: Download file

To download a file from Google drive take the following steps:

  1. Acquire an instance of TElGoogleDriveFile for the needed file either by calling TElGoogleDriveDataStorage.AcquireObject() or as a result of folder list operation. Cast the obtained object to TElGoogleDriveFile.
  2. Create a stream to which the data will be written.
  3. Call TElGoogleDriveFile.Read() or TElGoogleDriveDataStorage.ReadObject() to download file data.
  4. If you used AcquireObject() method to obtain an instance of TElGoogleDriveFile or cloned TElGoogleDriveFile, remember to use TElGoogleDriveFile.Release() method after the download is complete.

C#:


TElGoogleDriveFile file = storage.AcquireObject(@"...") as TElGoogleDriveFile;
try
{
    FileStream output = new FileStream(@"X:\downloaded.bin", FileMode.Create);
    try
    {
        file.Read(output);
    }
    finally
    {
        output.Close();
    }
}
finally
{
    file.Release();
}

TElGoogleDriveDataStorage class has OnProgress event, which allows to track and show the progress of data download, and interrupt the transfer if necessary.

If the file was encrypted or signed when it was uploaded to the server, then during downloading of such files the additional steps are to be taken.

How To articles about Google Drive cloud

Discuss this help topic in SecureBlackbox Forum