Class ContentItemAssetUploadedFileSource
- Namespace
- CMS.ContentEngine
- Assembly
- CMS.ContentEngine.dll
Represents a source of a content item asset originating from a file uploaded to the temp folder.
public sealed class ContentItemAssetUploadedFileSource : IContentItemAssetSource
- Inheritance
-
objectContentItemAssetUploadedFileSource
- Implements
- Extension Methods
Constructors
ContentItemAssetUploadedFileSource(string)
Initializes a new instance of the ContentItemAssetUploadedFileSource class.
public ContentItemAssetUploadedFileSource(string tempFilePath)
Parameters
tempFilePath
stringPath to the asset file in temp folder.
Exceptions
- ArgumentException
Thrown when
tempFilePath
is null or empty.
Properties
HasData
Indicates whether the source has data. Returns true if a file was uploaded to the TempFilePath, otherwise returns false.
public bool HasData { get; }
Property Value
- bool
TempFilePath
Path to the asset file in temp folder.
public string TempFilePath { get; }
Property Value
- string
Methods
Write(string, CancellationToken)
Writes the asset binary to targetAssetFilePath
by moving the underlying file from TempFilePath.
public Task Write(string targetAssetFilePath, CancellationToken cancellationToken)
Parameters
targetAssetFilePath
stringTarget file path where the asset binary is to be written.
cancellationToken
CancellationTokenThe cancellation instruction.
Returns
- Task
Returns a task representing the asynchronous operation.
Exceptions
- ArgumentException
Thrown when
targetAssetFilePath
is null or empty.