Discuss this help topic in SecureBlackbox Forum

WebDAV: Upload resource to server

If you have a local file to upload, you can use TElWebDAVClient.UploadFile() method.

Alternatively you can use one of TElWebDAVClient.Upload() methods, which let you upload the data from the byte array.

For even more flexibility you need to use streams. First of all you need to create a stream, write your data to this stream, then reset stream position to 0.

After preparing the stream you call TElWebDAVClient.UploadStream() method. Pass an instance of TElWebDAVErrorList class to UploadStream() method to get the list of errors, reported during the operation.

Examples:

C#:


TElWebDAVClient cli = new TElWebDAVClient();
cli.BaseURL = @"http://remote.com/dav_folder";

MemoryStream ms = MemoryStream(Encoding.UTF8.GetBytes("Hello world"));

TElWebDAVErrorList errs = new TElWebDAVErrorList(); // possible errors will be reported here

cli.UploadStream(ms, @"http://remote.com/dav_folder", TSBFileTransferMode.ftmOverwrite, null, errs);

How To articles about WebDAV client

Discuss this help topic in SecureBlackbox Forum