DocumentManagerCheckAllowedBinaryDocument Method Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Checks whether a file can be uploaded to Content Studio.

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

public void CheckAllowedBinaryDocument(
	ConnectionId connectionId,
	SessionId sessionId,
	Nullable<DocumentId> documentId,
	Nullable<CategoryId> categoryId,
	string originalFilename,
	string virtualPath,
	long fileLength
)

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: SystemNullableDocumentId
When supplied represents an existing document to save. If this parameter is null the check assumes that a new document should be created.
categoryId
Type: SystemNullableCategoryId
If documentId is null this parameter is required and must represent a "File" category, otherwise it is ignored.
originalFilename
Type: SystemString
The name of the file to upload
virtualPath
Type: SystemString
An non empty string that represents a site-unique virtual path name. This parameter cannot be null.
fileLength
Type: SystemInt64
The size (in bytes) of the file to upload.
Exceptions

ExceptionCondition
CSInvalidSessionException
CSPermissionDeniedException
CSDocumentNotFoundException
CSInvalidParameterExceptionoriginalFilename is an empty string
CSExceptionA business rule was violated in the underlying Content Studio database.
ArgumentNullExceptionA parameter cannot be null.
ArgumentOutOfRangeExceptionThe file name passed in is reserved
ArgumentExceptionA parameter data exceeded its maximum allowed length.
InvalidOperationExceptionCannot call the SaveBinary or CreateBinary method for regular documents.
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

Any authenticated caller can call this method and anonymous calls are supported.
Remarks

This method was introduced in Content Studio 5.6

This metod is typically used to test an upload operation before any real bytes have been uploaded. Most of the check operations that take place during one of the BinarySave or BinaryCreate methods are performed and if a check fails the appropriate exception are thrown.

See Also

Reference