Class FileUploaderComponent
Represents a file uploader form component. The component is designed for use in Forms application only.
public class FileUploaderComponent : FormComponent<FileUploaderProperties, BizFormUploadFile>
- Inheritance
-
objectFileUploaderComponent
- Inherited Members
- Extension Methods
Constructors
FileUploaderComponent()
Initializes a new instance of the FileUploaderComponent class.
public FileUploaderComponent()
Fields
IDENTIFIER
Represents the FileUploaderComponent identifier.
public const string IDENTIFIER = "Kentico.FileUploader"
Field Value
- string
Properties
DeleteOrReplaceFile
Gets or sets a value indicating whether to delete or replace the current form file.
public bool DeleteOrReplaceFile { get; set; }
Property Value
- bool
FileInputClientId
Represents the identifier of the file uploader.
public string FileInputClientId { get; }
Property Value
- string
LabelForPropertyName
Gets the name of the FileInputClientId property.
public override string LabelForPropertyName { get; }
Property Value
- string
MaxAllowedFileSize
Gets the maximal size of the file that can be uploaded in kilobytes.
public long MaxAllowedFileSize { get; }
Property Value
- long
OriginalFileName
Gets or sets the original file name of the form file.
public string OriginalFileName { get; set; }
Property Value
- string
- See Also
PlainOriginalFileName
Gets or sets the original file name of the form file.
public string PlainOriginalFileName { get; set; }
Property Value
- string
PlainSystemFileName
Represents the identifier of the permanent file that is already stored in the database and file system.
public string PlainSystemFileName { get; set; }
Property Value
- string
PlainTempFileIdentifier
Represents the identifier of the newly uploaded file in the unprotected format.
public Guid? PlainTempFileIdentifier { get; set; }
Property Value
- Guid?
ShowViewFileLink
Gets a value indicating whether to display a view file link after a file has previously been uploaded.
public bool ShowViewFileLink { get; }
Property Value
- bool
SystemFileName
Gets or sets the permanent file name of the form file.
public string SystemFileName { get; set; }
Property Value
- string
- See Also
TempFileIdentifier
Gets or sets the identifier of the newly uploaded file.
public string TempFileIdentifier { get; set; }
Property Value
- string
Remarks
File identifier is protected against tampering by the client.
- See Also
TempFileOriginalName
Gets the original name of the newly uploaded file.
public string TempFileOriginalName { get; }
Property Value
- string
Methods
BindContext(FormComponentContext)
Binds contextual information to the form component.
public override void BindContext(FormComponentContext context)
Parameters
context
FormComponentContext
Exceptions
- ArgumentException
Thrown when
context
is not an instance of BizFormComponentContext.
GetFileUploadParameters()
Returns parameters to Kentico.Forms.Web.Mvc.Internal.KenticoFormFileUploaderController.PostFile(int, string, string) endpoint for file upload from this form component.
public FileUploadEndpointParameters GetFileUploadParameters()
Returns
GetValue()
Gets the identification string of the form file. Gets the TempFileIdentifier.
public override BizFormUploadFile GetValue()
Returns
SetValue(BizFormUploadFile)
Sets the identification string of the form file.
public override void SetValue(BizFormUploadFile value)
Parameters
value
BizFormUploadFile
Validate(ValidationContext)
Validates whether the submitted temp file still exists.
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
Parameters
validationContext
ValidationContextThe validation context.
Returns
- IEnumerable<ValidationResult>
A collection that holds failed-validation information.