DocumentReaderGetBinaryContent Method (ConnectionId, SessionId, DocumentId, Int32) Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Returns the content together with its size and type of a document. The content returned is Base64 binary data.

Namespace: ContentStudio.Document
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public Stream GetBinaryContent(
	ConnectionId connectionId,
	SessionId sessionId,
	DocumentId documentId,
	int version
)

Parameters

connectionId
Type: ContentStudioConnectionId
A value that identifies the web site
sessionId
Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId).
documentId
Type: ContentStudio.DocumentDocumentId
An identifier of the document whose content should be read
version
Type: SystemInt32
The version of the document to return.
ValueMeaning
-2Returns the draft. If no draft exists the currently approved content is returned.
-1Returns the draft. If no draft exists a ContentStudio.CSException is thrown.
0Returns the currently approved content. If no approved content exists a ContentStudio.CSException is thrown
Any existing version number Returns the content of the specified version.

Return Value

Type: Stream

A stream containing xml. The caller must close the stream after the call.

<root>
    <status>Integer value</status>
    <statustext>String value</statustext>
    <content contenttype="String value" 
             size="Integer value"
             contentbinary="String value"
    />
</root>

The xml has the following elements and attributes.

Xml specification
ElementAttributeDescription
root/status Indicates the outcome of the call. This value is always zero (0) which indicates success.
root/statustext The textual representation of the call. This value is always "Success".
root/content The element that contains the attributes containing the data.
root/contentcontenttypeA value that contains the content type (Mime type) of the returned data.
root/contentsizeA value that represents the size of the data.
root/contentcontentbinaryThe binary content. This value is a Base64 encoded data.
Exceptions

ExceptionCondition
CSExceptionA business rule was violated in the underlying Content Studio database
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

READ permission on the document is required to read a draft and BROWSE for any approved content. This method supports anonymous users.
See Also

Reference