AnsweredAssumed Answered

CreateDocument Error

Question asked by scott.thomas on Feb 16, 2017

I'm hoping people can help with this one.  I'm trying to create a document with portCMIS and it errors every time.  I'm just trying to follow the example online.  Here's my sample code:

 

string textFileName = "test.txt";
string content = "Hello World!";
byte[] bytes = Encoding.UTF8.GetBytes(content);
string filename = textFileName;
IContentStream stream = ContentStreamUtils.CreateByteArrayContentStream(textFileName, bytes, "application/octet-stream");


IDictionary<string, object> properties = new Dictionary<string, object>();
properties[PropertyIds.Name] = textFileName;
properties[PropertyIds.ObjectTypeId] = "cmis:document";

// create the document
var d = session.CreateDocument(properties, session.CreateObjectId(contentFolder.Id), stream, VersioningState.None);

 

This always errors with a System.ArgumentOutOfRangeException.

 

Any ideas what I'm doing wrong would be most approeciated.

Outcomes