Upload file to Documentum via .NET API
-
10-02-2021 - |
سؤال
I am looking to upload a file from SharePoint to documentum via .NET API and looking for possible options.
I have come across these solutions:
Interop Assemblies for Documentum (I have heard they will be deprecated)
This codeplex solution
Can anyone tell me the preferred approaches and their associated protocols (HTTP, TCP ) ?
المحلول
i'm not familiar with Documentum, but theoretically you can upload files to any system if you can perform HttpRequest's (PUT operations). Here's an example:
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);
}
لا تنتمي إلى StackOverflow