Click or drag to resize
AttachmentInfoProviderAddTemporaryAttachment Method (Guid, Guid, Guid, HttpPostedFile, Int32, Int32, Int32, Int32)

Note: This API is now obsolete.

Adds the temporary attachment to the document, updates the attachment if currently present.

Namespace: CMS.DocumentEngine
Assembly: CMS.DocumentEngine (in CMS.DocumentEngine.dll) Version: 13.0.131
Syntax
C#
[ObsoleteAttribute("Use 'CMS.DocumentEngine.AttachmentInfoProvider.AddTemporaryAttachment(System.Guid, System.Guid, System.Guid, CMS.Base.IUploadedFile, System.Int32, System.Int32, System.Int32, System.Int32)' instead. You can use the 'CMS.Base.UploadExtensions.ToUploadedFile' extensions method for converting 'System.Web.HttpPostedFile' to the 'CMS.Base.IUploadedFile'.")]
public static AttachmentInfo AddTemporaryAttachment(
	Guid formGuid,
	Guid attachmentGuid,
	Guid groupGuid,
	HttpPostedFile file,
	int siteId,
	int width = -1,
	int height = -1,
	int maxSideSize = -1
)

Parameters

formGuid
Type: SystemGuid
GUID of the form
attachmentGuid
Type: SystemGuid
GUID of the attachment (optional)
groupGuid
Type: SystemGuid
GUID of the attachment group (optional)
file
Type: System.WebHttpPostedFile
Attachment file
siteId
Type: SystemInt32
Site ID
width (Optional)
Type: SystemInt32
New width of the image attachment (Use ImageHelper.AUTOSIZE to keep the width)
height (Optional)
Type: SystemInt32
New height of the image attachment (Use ImageHelper.AUTOSIZE to keep the height)
maxSideSize (Optional)
Type: SystemInt32
Maximal side size of the image attachment

Return Value

Type: AttachmentInfo
See Also