Discuss this help topic in SecureBlackbox Forum
Clouds: Upload file
To upload a file to the server
- Obtain the
TElOneDriveFolder object for the folder, to which the new file is to be placed.
-
Call TElOneDriveFolder.CreateObject() method of the above object, and pass it
the name of the new file.
The method creates a file on the server and returns a TElOneDriveFile object for the created file.
If OverwriteIfExists parameter of CreateObject() method was set to false, and the file with the provided name already exists on the server,
EElOneDriveServerError exception with "resource_already_exists" error code will be thrown.
-
Upload the data to the newly created file as described in this how-to article.
-
If you used AcquireObject() method to obtain an instance of TElOneDriveFolder or cloned TElOneDriveFolder,
remember to use TElOneDriveFolder.Release() method after the upload is complete.
C#:
TElOneDriveFile file = folder.CreateObject("uploaded.bin", true);
try
{
FileStream source = new FileStream(@"...", FileMode.Open, FileAccess.Read);
try
{
file.Write(source);
}
finally
{
source.Close();
}
}
finally
{
file.Release();
}
If the data being uploaded to the server are to be encrypted or signed,
you need to take certain additional steps.
How To articles about OneDrive cloud
Discuss this help topic in SecureBlackbox Forum