通过.NET API将文件上传到Documentum

时间:2011-10-17 09:42:40

标签: .net sharepoint documentum

我希望通过.NET API将文件从SharePoint上传到documentum,并寻找可能的选项。

我遇到过这些解决方案:

  • Documentum的互操作程序集(我听说它们将被弃用)

  • This codeplex解决方案

有人能告诉我首选方法及其相关协议(HTTP,TCP)吗?

1 个答案:

答案 0 :(得分:0)

我不熟悉Documentum,但理论上如果你可以执行HttpRequest(PUT操作),你可以将文件上传到任何系统。这是一个例子:

string localFilename = "<path to file you wish to upload>";
// ex. c:\temp\myFileToUpload.doc

FileStream myStream = new FileStream(localFilename, FileMode.Open, FileAccess.Read);
BinaryReader myReader = new BinaryReader(myStream);
byte[] bytesToOutput = reader.ReadBytes((int)myStream.Length);
myReader.Close();
myStream.Close();

using (WebClient client = new WebClient())
{
    client.Credentials = System.Net.CredentialCache.DefaultCredentials;
    client.UploadData(uploadPath, "PUT", bytesToOutput);
}