Mark-sai Respected Contributor.
Respected Contributor.
537 views

attach document to a record using fileStream instead of file path

Is there a way we can upload the document to the record using byte[] file stream instead of physical file path?

I only find inputDoucment.SetAsFile (FilePath) method in the documentation.

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

Re: attach document to a record using fileStream instead of file path

Unless I have missed something no.  You can get a document as a byte stream using either DocumentStream or DownloadNotifier.

It is not an area I usually work so I am not sure but there may be tricky ways to get a document in the store so then you can just specify the store id on the InputDocument.

If this is an important requirement let me know and I will follow it up.

 


Blog | Samples | HPE CM 9.3 SDK Docs
**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of MicroFocus**
0 Likes
Highlighted
Mark-sai Respected Contributor.
Respected Contributor.

Re: attach document to a record using fileStream instead of file path

Thanks David,

I am actually trying to get the file from Sharepoint and upload to RM using the SDK. As we cannot get file path from sharepoint, we can only use byte stream to get the file. 

Alternatively, I can write to the disk in the temp location then  can upload to RM. Not a pretty solution though. 

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: attach document to a record using fileStream instead of file path

Sorry Mark, looks like the only solution is the non-pretty one.

If it is any comfort even if you were able to use a stream the SDK would usually write it out to file anyway as it stores a local document cache.


Blog | Samples | HPE CM 9.3 SDK Docs
**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of MicroFocus**
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.