Click or drag to resize
BizFormFileServiceExtensionsSaveUploadedFileAsTempFile Method
Saves uploaded form file as a temporary file to the file system. The file can be optionally resized if it is an image file. The type of the file is determined from the postedFile's FileName.

Namespace: CMS.OnlineForms
Assembly: CMS.OnlineForms (in CMS.OnlineForms.dll) Version: 13.0.131
Syntax
C#
public static void SaveUploadedFileAsTempFile(
	this IBizFormFileService bizFormFileService,
	HttpPostedFileBase postedFile,
	string tempFileIdentifier,
	string tempFilesFolderPath,
	int width,
	int height,
	int maxSideSize
)

Parameters

bizFormFileService
Type: CMS.OnlineFormsIBizFormFileService
The IBizFormFileService.
postedFile
Type: System.WebHttpPostedFileBase
Posted file from a client.
tempFileIdentifier
Type: SystemString
Identifier of the temporary file to derive file name from.
tempFilesFolderPath
Type: SystemString
Folder path where temporary form files are being saved.
width
Type: SystemInt32
Required image width to resize the postedFile to if the file is an image file, or 0.
height
Type: SystemInt32
Required image height to resize the postedFile to if the file is an image file, or 0.
maxSideSize
Type: SystemInt32
Required image max side size to resize the postedFile to if the file is an image file, or 0.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IBizFormFileService. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when postedFile is null.
ArgumentExceptionThrown when tempFileIdentifier or tempFilesFolderPath is null or an empty string.
See Also