0

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

我遇到了这些解决方案:

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

  • 这个codeplex 解决方案

谁能告诉我首选方法及其相关协议(HTTP、TCP)?

4

1 回答 1

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);
}
于 2011-10-19T11:37:16.017 回答