Hi Everyone.
We are using API to integrate our application to eB for retrieving document, uploading document, etc.
After upgrading to eB 16.7 the function for getting eB document seems not working , while it works perfectly in previous eB 15.6
We use protoproxy,GetDocFile, given the fileID is already retrieved in the prior process
The error shows that null reference is given.. (attached in pics below)
Is protoproxy,GetDocFile cannot be used anymore in eB 16.7 ? i know it is marked obsoleted but i thought it will still be working fine
Are there any advise on how to achieve same thing (getting the document) without using protoproxy ?
Below is my code :
[HttpGet]
public FileStreamResult GeteBFile(Int32? FileId, String FileName)
{
if (session == null)
ConnectToeB();
if (FileId > 0)
Stream mStream = new MemoryStream();
session.ProtoProxy.GetDocFile(session.Writer.SessionToken, FileId.Value, ref mStream);
mStream.Seek(0, SeekOrigin.Begin);
return File(mStream, "application/force-download", FileName);
}
else
return null;
You can use the object model. Something like the following should work
Data.File originalFile = new Data.File(session, FileId.Value);originalFile.Retreive("Header;Repositories");Stream mStream = new MemoryStream();originalFile.ContentData = new ContentData.File(originalFile, mStream);originalFile.ContentData.ReadAllBytes();mStream.Seek(0, SeekOrigin.Begin);return File(mStream, "application/force-download", FileName);
Regards,
Michael