Click or drag to resize
UploadedFileExtensionsGetBytes Method

Gets the content of uploaded file as byte array with array length equal to Length.

When the CanOpenReadStream is then the input stream will be accessed via OpenReadStream method and then disposed.

When the CanOpenReadStream is then the input stream will be accessed via InputStream method, attempted to seek to the beginning and then read.

Namespace: CMS.Base.Internal
Assembly: CMS.Base (in CMS.Base.dll) Version: 13.0.131
Syntax
C#
public static byte[] GetBytes(
	this IUploadedFile uploadedFile
)

Parameters

uploadedFile
Type: CMS.BaseIUploadedFile

Return Value

Type: Byte

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IUploadedFile. 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
InvalidOperationException Thrown when input stream cannot be read or when the stream is not in the beginning and cannot be seek.
See Also