Please enable JavaScript to view this site.

QPR Knowledge Base 2019.1

Navigation: Developer's Guide > QPR Web Services Foundation > Functions

GetBinaryDataAsStream

Scroll Prev Top Next More

Revision history:

Introduced in QPR 8.1

 

Returns binary data as a stream from an object defined in the function call. This function can be used to fetch graphs and embedded data from objects.

 

Synopsis:

 

Stream GetBinaryDataAsStream(string sessionId, string objectId, string attribute, string options)

 

Return Value:

 

A Stream object.

 

Parameters:

 

sessionId: String. ID of an authenticated session. This can alternatively be provided as a value of the request header parameter "sessionid".

objectId: String. ID of an object from which binary data is fetched.

attribute: String. Supported binary data attributes:

PG

ograph. Querying this attribute equals to calling GetGraph with the attribute's parameters as the value of the Options parameter. See GetGraph for a list of supported parameters.

oembeddeddata. Returns the data embedded in an information item. Note: To check whether an information item is embedded, query the infoitem.embedtype attribute.

SC

ograph. Querying this attribute equals to calling GetGraph with the attribute's parameters as the value of the Options parameter. See GetGraph for a list of supported parameters.

Portal

oembeddeddata. Returns the data embedded in an embedded attachment. Note that you can use for instance [PO].EmbeddedAttachment to get a list of all embedded attachments in the database.

options: String. List of comma-separated parameters. Language parameters are available similarly as in the QueryObjects function.

 

 

Example Procedure:

 

NOTE: The example below requires Integrated Windows Authentication to be used. Otherwise authentication needs to be done e.g. via JavaScript.

 

<html>

<head>

<title>Binary Attachment</title>

</head>

<body>

<p>Embedded attachment from QPR Web Services Foundation</p>

<a href="http://localhost/QPR2019-1/Portal/QPR.ISAPI.dll/wsforward/MainService.svc/webHttp/GetBinaryDataAsStream?objectId=%22PO.0.686650742%22&attribute=%22embeddeddata%22">View attachment</a>

</body>

</html>