I am trying to implement an uploading functionality using OpenCMIS for C# and on OpenKM Server. I would like to allow uploading existing files in a specific directory, and having something like this: Filename, Filename(1), Filename(2), etc. OpenCMIS doesn't allow multiple files with the same name(I get : Apache Chemistry OpenCMIS - nameConstraintViolation error). I could check all the filenames in the directory and parsing their names, but this seems not be the best solution.
I also tried, when creating the document to set
IDictionary<string, object> properties = new Dictionary<string, object>();
properties[PropertyIds.Name] = documentName;
properties[PropertyIds.ObjectTypeId] = "cmis:document";
properties[PropertyIds.ContentStreamId] = 1;
ContentStream contentStream = new ContentStream();
contentStream.MimeType = MimeTypes.GetMimeType(fileName);
contentStream.Length = memStream.Length;
contentStream.Stream = memStream;
IDocument doc = resourceFolder.CreateDocument(properties, contentStream, null);
but I get the property ContentStreamId null, and in this way to keep track of existing files with the same name, but different versions. I don't know if versioning the files would help me because I would also like to allow listing the files from the folder and download them. Is there any better idea for doing this?