Discuss this help topic in SecureBlackbox Forum

Clouds: Write data to existing file

To write the data into the existing file

  1. Obtain the TElBoxFile object of the exising file which will be updated.
  2. Call TElBoxFile.Write() method of the above object, and pass it the stream, the data from which are to be placed to the file.

C#:


TElBoxFile file = storage.AcquireFile("uploaded.bin");
try
{
   FileStream source = new FileStream(@"...", FileMode.Open, FileAccess.Read);
   try
   {
       file.Write(source);
   }
   finally
   {
       source.Close();
   }
}
finally
{
   file.Release();
}

Use OnProgress event of TElBoxDataStorage class to track and show the progress of data upload, and interrupt the transfer if necessary.

Unfortunately Box.com service doesn't support uploading of the file part, so TElBoxDataStorage.WriteBlock() method throws the exception with "unsupported operation" in its Code property.

How To articles about Box.com cloud

Discuss this help topic in SecureBlackbox Forum