如何从本地文件创建DotCMIS.Data.IContentStream对象?
本教程仅介绍如何从内存中的字节数组创建一个字节数组:
byte[] content = UTF8Encoding.UTF8.GetBytes("Hello World!");
ContentStream contentStream = new ContentStream();
contentStream.FileName = "hello-world.txt";
contentStream.MimeType = "text/plain";
contentStream.Length = content.Length;
contentStream.Stream = new MemoryStream(content);发布于 2014-06-27 11:07:23
Stream实际上是.NET的标准System.IO.Stream,下面是如何从本地文件创建DotCMIS IContentStream:
ContentStream contentStream = new ContentStream();
contentStream.FileName = "hello-world.txt";
contentStream.MimeType = "text/plain";
contentStream.Stream = File.Open("hello-world.txt", FileMode.Open);
contentStream.Length = contentStream.Stream.Length;https://stackoverflow.com/questions/24443251
复制相似问题