Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Highlighted
timtraf Absent Member.
Absent Member.
968 views

Streaming a document using GetDocumentPathInClientCache

Jump to solution

I'm using HP.HPTRIM.SDK.dll version 7.3.1.5352

 

I would be interested to hear from anyone who has successfully retrieved a document from the Trim Record object as a byte array or binary stream.

 

Does Record.GetDocumentPathInClientCache return a URI that I can use to retrieve the actual document location?

 

 

Thanks, Tim.

0 Likes
1 Solution

Accepted Solutions
Matt Bayliss Contributor.
Contributor.

Re: Streaming a document using GetDocumentPathInClientCache

Jump to solution

Hi Tim,

 

GetDocumentPathInClientCache is in the right direction.

 

This is how I stream records from TRIM:

 

private FileStream GetRecordStream(Record rec)
{
	FileStream fileStream = null;
	if (!rec.IsDocumentInClientCache)
	{
		rec.LoadDocumentIntoClientCache();
	}

	var filePath = rec.GetDocumentPathInClientCache(HistoryTypes.ErecRevisionExtracted);

	if (!string.IsNullOrEmpty(filePath))
	{
		fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
	}
	return fileStream;
}

 

 

Hope that helps,

 

Regards

 

Matt.

0 Likes
4 Replies
Micro Focus Expert
Micro Focus Expert

Re: Streaming a document using GetDocumentPathInClientCache

Jump to solution

I'll ask around the developers and see if they know a way to sort this.

**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of Micro Focus**
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Streaming a document using GetDocumentPathInClientCache

Jump to solution

Not having too much luck here, if you get stuck log a support case through for further investigation.

**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of Micro Focus**
0 Likes
Matt Bayliss Contributor.
Contributor.

Re: Streaming a document using GetDocumentPathInClientCache

Jump to solution

Hi Tim,

 

GetDocumentPathInClientCache is in the right direction.

 

This is how I stream records from TRIM:

 

private FileStream GetRecordStream(Record rec)
{
	FileStream fileStream = null;
	if (!rec.IsDocumentInClientCache)
	{
		rec.LoadDocumentIntoClientCache();
	}

	var filePath = rec.GetDocumentPathInClientCache(HistoryTypes.ErecRevisionExtracted);

	if (!string.IsNullOrEmpty(filePath))
	{
		fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
	}
	return fileStream;
}

 

 

Hope that helps,

 

Regards

 

Matt.

0 Likes
timtraf Absent Member.
Absent Member.

Re: Streaming a document using GetDocumentPathInClientCache

Jump to solution

Appreciate your help Matt!

Cheers

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.