Click or drag to resize
DocumentHelperAddAttachment Method (TreeNode, String, Guid, Guid, AttachmentSource, Int32, Int32, Int32)
Adds an attachment to the document. Does not update the document to the database, updates the attachment if currently present.

Namespace: CMS.DocumentEngine
Assembly: CMS.DocumentEngine (in CMS.DocumentEngine.dll) Version: 12.0.0
Syntax
C#
public static DocumentAttachment AddAttachment(
	TreeNode node,
	string guidColumnName,
	Guid attachmentGuid,
	Guid groupGuid,
	AttachmentSource source,
	int width = -1,
	int height = -1,
	int maxSideSize = -1
)

Parameters

node
Type: CMS.DocumentEngineTreeNode
Document node
guidColumnName
Type: SystemString
Column containing the Attachment GUID (optional)
attachmentGuid
Type: SystemGuid
GUID of the attachment (optional)
groupGuid
Type: SystemGuid
GUID of the attachment group (optional)
source
Type: CMS.DocumentEngineAttachmentSource
Attachment source (HttpPostedFile, AttachmentInfo or file path)
width (Optional)
Type: SystemInt32
New width of the image attachment
height (Optional)
Type: SystemInt32
New height of the image attachment
maxSideSize (Optional)
Type: SystemInt32
Maximum side size of the image attachment

Return Value

Type: DocumentAttachment
See Also