Hi Folks. I'm having trouble uploading a small PDF document into ECM. The document content is successfully created, however, the file appears to be corrupt when I try to open it in ECM (or even if I first download it and then open it). Here's by C# code below:
string contextId = docMan.CreateDocumentContext(OtAuth, destNode.ID, sessionProperties.FileName, FileComment, false, null);
resultsMessage += Environment.NewLine + string.Format("Successfully created docuemnt context. Size of file as bytes is: {0}", fileAsBytes.Length);
Stream fs = new MemoryStream(fileAsBytes);
resultsMessage += Environment.NewLine + string.Format("Converted the byte array into a file stream of size {0}. About to upload the content...", fs.Length);
contentService.UploadContent(ContentAuthentication, contextId, uploadFileAttributes, fs);
When I go into ECM and try to open the file, here's the error I'm getting:

Also, here's my binding configuration to connect to the ContentService:
<binding name="ContentServiceBinding" closeTimeout="00:05:00"
openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
messageEncoding="Mtom" transferMode="Streamed"
useDefaultWebProxy="true">
Can someone tell me what I'm doing wrong?
Thanks in advance!
- Dylan