03-10-2014 05:32 PM
// fake file
string fileContent = "This is content for a fake file";
byte[] file = GetBytes(fileContent);
// define new document stream object
ContentStream contentStream = new ContentStream
{
FileName = fileName,
Length = file.Length,
MimeType = "application/msword",
Stream = new MemoryStream( file)
};
Document doc = ((Document)session.GetObjectByPath(parentFolder.Path +"/" + fileName));
doc.UpdateProperties(properties);
doc.SetContentStream(contentStream, true);
where GetBytes is a custom defined function
static byte[] GetBytes(string str)
{
byte[] bytes = new byte[str.Length * sizeof(char)];
System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
return bytes;
}
03-11-2014 04:44 AM
03-11-2014 06:43 AM
03-11-2014 06:14 AM
03-11-2014 06:49 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.