DocumentManagerCreateBinary Method (ConnectionId, SessionId, DocumentId, Int32, CategoryId, String, String, Object, Object, Object, String, String, Byte, String, String, String, String, String, Int32, String, String) Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Creates a new binary document. The document can only be created in a category for binary documents (uploaded files). This methods supports anonymous callers.

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

public virtual int CreateBinary(
	ConnectionId connectionId,
	SessionId sessionId,
	DocumentId parentDocumentId,
	int orderInHierarchy,
	CategoryId categoryId,
	string originalFileName,
	string documentName,
	Object published,
	Object publishDate,
	Object archiveDate,
	string marking,
	string description,
	byte[] content,
	string keywords,
	string menuData,
	string menuTarget,
	string menuUrl,
	string guoid,
	int bufferSize,
	string virtualPath,
	out string retFileName
)

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).
parentDocumentId
Type: ContentStudio.DocumentDocumentId
The id of an existing document that should be the parent of the new document. Pass zero if the document is not a part of a document hierarchy and has no parent.
orderInHierarchy
Type: SystemInt32
Specifies how the document should be sorted within its document hierarchy within the same level. This parameter should be zero to let Content Studio decide the order.
categoryId
Type: ContentStudio.DocumentCategoryId
The id of an existing category that will host the document.
originalFileName
Type: SystemString
The file name of the document. This parameter cannot be a zero length string and cannot exceed MAX_DOCUMENTNAME_SIZE number of characters. If this parameter is a single file extension Content Studio will supply a file name (guid + extension) otherwise this name will be used as document name and file name. If a file name without extension is supplied the DocumentName will be used unless DocumentName is empty.
documentName
Type: SystemString
The name of the document. This parameter is ignored if the caller supplies a file name in the OriginalFileName parameter but is used as a document name if only a file extension is passed in the OriginalFileName parameter.
published
Type: SystemObject
Indicates if the document should be published or not. This parameter must be possible to cast or convert to a boolean but can be null to indicate to use the default value.
publishDate
Type: SystemObject
A DateTime value that indicates the date when the document should be published. This parameter must be possible to cast or convert to the DateTime datatype but can be null to use the default value.
archiveDate
Type: SystemObject
A DateTime value that indicates when the document should be archived and no longer published. To indicate no limit pass DateTime.MinValue or an empty string. This parameter must be possible to cast or convert to the but can be null to use the default value.
marking
Type: SystemString
A short description of the document. This parameter cannot exceed MAX_MARKING_SIZE number of characters. This parameter can be null to use the default value.
description
Type: SystemString
The description for the document. This value is used as the ALT-tag when users link to the file in Content Studio. If this parameter is null the document name is used as ALT-tag
content
Type: SystemByte
A byte array that contains the binary content to save. This parameter cannot be null.
keywords
Type: SystemString
A list of keywords for the document. This value cannot exceed MAX_KEYWORD_SIZE characters in length. This parameter can be null to use the default value.
menuData
Type: SystemString
User defined data for menu items. Only applicable if the document acts as a menu node. This value cannot exceed MAX_MENU_DATA_SIZE characters in length. This parameter can be null to use the default value.
menuTarget
Type: SystemString
User defined target for menu items. Only applicable if the document acts as a menu node. This value cannot exceed MAX_MENU_TARGET_SIZE characters in length. This parameter can be null to use the default value.
menuUrl
Type: SystemString
User defined url data for menu items. Only applicable if the document acts as a menu node. This value cannot exceed MAX_MENU_URL_SIZE characters in length. This parameter can be null to use the default value.
guoid
Type: SystemString
A unique identifier from a copied document. This parameter must be a valid GUOID or null and is only used by the Content Studio advanced copying functionality.
bufferSize
Type: SystemInt32
The size used when writing chunked data. Pass zero to use the default buffer value
virtualPath
Type: SystemString
The virtual path for this document. The virtual path must be unique on each site.
retFileName
Type: SystemString
Returns the relative filename of the document.

Return Value

Type: Int32
The return value is the id of the newly created document.
Exceptions

ExceptionCondition
CSExceptionA business rule was violated in the underlying Content Studio database.
ArgumentExceptionA parameter data exceeded its maximum allowed length.
ArgumentNullExceptionA parameter cannot be null.
SqlExceptionAn error occurred when executing the command against the Content Studio database
InvalidOperationExceptionCannot call the CreateBinary method for regular documents
Content Studio permissions

Create/Write permission on the category is required. Some of the properties that involve publishing rules like Published or PublishDate require Approve permission on the document. If the caller lacks this permission these fields are ignored. Additionally, if workflow is applicable, workflow rules will apply as well.
The caller must have the WriteActiveContent global right set on at least of her groups in order to upload restricted file types. For a list of restricted file extensions see the the WriteActiveContent global right.
Remarks

This method was added in Content Studio version 5.3.
See Also

Reference