Class UploaderBuilder
Inheritance
System.Object
UploaderBuilder
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Syncfusion.EJ2.dll
public class UploaderBuilder : ControlBuilder
Constructors
Declaration
Declaration
public UploaderBuilder(Uploader model)
Parameters
Fields
Declaration
Field Value
Properties
Declaration
public IDictionary<string, object> HtmlAttr { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.IDictionary<System.String, System.Object> |
|
Declaration
public string ID { get; set; }
Property Value
Type |
Description |
System.String |
|
Declaration
public override TextWriter Output { get; set; }
Property Value
Type |
Description |
System.IO.TextWriter |
|
Overrides
Methods
Triggers after all the selected files has processed to upload successfully or failed to server.
Declaration
public UploaderBuilder ActionComplete(string actionComplete)
Parameters
Type |
Name |
Description |
System.String |
actionComplete |
|
Returns
Specifies the extensions of the file types allowed in the uploader component and pass the extensions
with comma separators. For example,
if you want to upload specific image files, pass allowedExtensions as “.jpg,.png”.
Declaration
public UploaderBuilder AllowedExtensions(string allowedExtensions)
Parameters
Type |
Name |
Description |
System.String |
allowedExtensions |
|
Returns
Configures the save and remove URL to perform the upload operations in the server asynchronously.
Declaration
public UploaderBuilder AsyncSettings(UploaderAsyncSettings asyncSettings)
Parameters
Returns
Declaration
public UploaderBuilder AsyncSettings(Action<UploaderAsyncSettingsBuilder> asyncSettings)
Parameters
Returns
By default, the uploader component initiates automatic upload when the files are added in upload queue.
If you want to manipulate the files before uploading to server, disable the autoUpload property.
The buttons “upload” and “clear” will be hided from file list when autoUpload property is true.
Declaration
public UploaderBuilder AutoUpload(bool autoUpload = true)
Parameters
Type |
Name |
Description |
System.Boolean |
autoUpload |
|
Returns
Triggers on remove the uploaded file. The event used to get confirm before remove the file from server.
Declaration
public UploaderBuilder BeforeRemove(string beforeRemove)
Parameters
Type |
Name |
Description |
System.String |
beforeRemove |
|
Returns
Triggers when the upload process before. This event is used to add additional parameter with upload request.
Declaration
public UploaderBuilder BeforeUpload(string beforeUpload)
Parameters
Type |
Name |
Description |
System.String |
beforeUpload |
|
Returns
You can customize the default text of “browse, clear, and upload” buttons with plain text or HTML elements.
The buttons’ text can be customized from localization also. If you configured both locale and buttons property,
the uploader component considers the buttons property value.
{% codeBlock src='uploader/buttons/index.md' %}{% endcodeBlock %}
Declaration
public UploaderBuilder Buttons(UploaderButtonsProps buttons)
Parameters
Returns
Declaration
public UploaderBuilder Buttons(Action<UploaderButtonsPropsBuilder> buttons)
Parameters
Returns
Fires if cancel the chunk file uploading.
Declaration
public UploaderBuilder Canceling(string canceling)
Parameters
Type |
Name |
Description |
System.String |
canceling |
|
Returns
Triggers when changes occur in uploaded file list by selecting or dropping files.
Declaration
public UploaderBuilder Change(string change)
Parameters
Type |
Name |
Description |
System.String |
change |
|
Returns
Fires if the chunk file failed to upload.
Declaration
public UploaderBuilder ChunkFailure(string chunkFailure)
Parameters
Type |
Name |
Description |
System.String |
chunkFailure |
|
Returns
Fires when the chunk file uploaded successfully.
Declaration
public UploaderBuilder ChunkSuccess(string chunkSuccess)
Parameters
Type |
Name |
Description |
System.String |
chunkSuccess |
|
Returns
Fires when every chunk upload process gets started. This event is used to add additional parameter with upload request.
Declaration
public UploaderBuilder ChunkUploading(string chunkUploading)
Parameters
Type |
Name |
Description |
System.String |
chunkUploading |
|
Returns
Triggers before clearing the items in file list when clicking “clear”.
Declaration
public UploaderBuilder Clearing(string clearing)
Parameters
Type |
Name |
Description |
System.String |
clearing |
|
Returns
Triggers when the component is created.
Declaration
public UploaderBuilder Created(string created)
Parameters
Type |
Name |
Description |
System.String |
created |
|
Returns
Specifies the CSS class name that can be appended with root element of the uploader.
One or more custom CSS classes can be added to a uploader.
Declaration
public UploaderBuilder CssClass(string cssClass)
Parameters
Type |
Name |
Description |
System.String |
cssClass |
|
Returns
Specifies a Boolean value that indicates whether the folder of files can be browsed in the uploader component.
Declaration
public UploaderBuilder DirectoryUpload(bool directoryUpload = true)
Parameters
Type |
Name |
Description |
System.Boolean |
directoryUpload |
|
Returns
Specifies the drop target to handle the drag-and-drop upload.
By default, the component creates wrapper around file input that will act as drop target.
Declaration
public UploaderBuilder DropArea(string dropArea)
Parameters
Type |
Name |
Description |
System.String |
dropArea |
|
Returns
Specifies the drag operation effect to the uploader component. Possible values are Copy , Move, Link and None.
Declaration
public UploaderBuilder DropEffect(DropEffect dropEffect)
Parameters
Returns
Specifies Boolean value that indicates whether the component is enabled or disabled.
The uploader component does not allow to interact when this property is disabled.
Declaration
public UploaderBuilder Enabled(bool enabled = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enabled |
|
Returns
Specifies Boolean value that indicates whether to prevent the cross site scripting code in filename or not.
The uploader component removes the cross-site scripting code or functions from the filename and shows the validation error message to the user when enableHtmlSanitizer is true.
Declaration
public UploaderBuilder EnableHtmlSanitizer(bool enableHtmlSanitizer = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableHtmlSanitizer |
|
Returns
Enable or disable persisting component's state between page reloads.
Declaration
public UploaderBuilder EnablePersistence(bool enablePersistence = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enablePersistence |
|
Returns
Enable or disable rendering component in right to left direction.
Declaration
public UploaderBuilder EnableRtl(bool enableRtl = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableRtl |
|
Returns
Triggers when the AJAX request fails on uploading or removing files.
Declaration
public UploaderBuilder Failure(string failure)
Parameters
Type |
Name |
Description |
System.String |
failure |
|
Returns
Triggers before rendering each file item from the file list in a page.
It helps to customize specific file item structure.
Declaration
public UploaderBuilder FileListRendering(string fileListRendering)
Parameters
Type |
Name |
Description |
System.String |
fileListRendering |
|
Returns
Declaration
public UploaderBuilder Files(Action<UploaderUploadedFilesBuilder> files)
Parameters
Returns
Specifies the list of files that will be preloaded on rendering of uploader component.
The property used to view and remove the uploaded files from server. By default, the files are configured with
uploaded successfully state. The following properties are mandatory to configure the preload files:
Name
Size
Type
Declaration
public UploaderBuilder Files(List<UploaderUploadedFiles> files)
Parameters
Returns
You can add the additional html attributes such as disabled, value etc., to the element.
If you configured both property and equivalent html attribute then the component considers the property value.
Declaration
public UploaderBuilder HtmlAttributes(object htmlAttributes)
Parameters
Type |
Name |
Description |
System.Object |
htmlAttributes |
|
Returns
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
public UploaderBuilder Locale(string locale)
Parameters
Type |
Name |
Description |
System.String |
locale |
|
Returns
Specifies the maximum allowed file size to be uploaded in bytes.
The property used to make sure that you cannot upload too large files.
Declaration
public UploaderBuilder MaxFileSize(double maxFileSize)
Parameters
Type |
Name |
Description |
System.Double |
maxFileSize |
|
Returns
Specifies the minimum file size to be uploaded in bytes.
The property used to make sure that you cannot upload empty files and small files.
Declaration
public UploaderBuilder MinFileSize(double minFileSize)
Parameters
Type |
Name |
Description |
System.Double |
minFileSize |
|
Returns
Specifies a Boolean value that indicates whether the multiple files can be browsed or
dropped simultaneously in the uploader component.
Declaration
public UploaderBuilder Multiple(bool multiple = true)
Parameters
Type |
Name |
Description |
System.Boolean |
multiple |
|
Returns
Fires if pause the chunk file uploading.
Declaration
public UploaderBuilder Pausing(string pausing)
Parameters
Type |
Name |
Description |
System.String |
pausing |
|
Returns
Triggers when uploading a file to the server using the AJAX request.
Declaration
public UploaderBuilder Progress(string progress)
Parameters
Type |
Name |
Description |
System.String |
progress |
|
Returns
Triggers on removing the uploaded file. The event used to get confirm before removing the file from server.
Declaration
public UploaderBuilder Removing(string removing)
Parameters
Type |
Name |
Description |
System.String |
removing |
|
Returns
Declaration
public HtmlString Render()
Returns
Type |
Description |
System.Web.HtmlString |
|
DEPRECATED-Triggers before rendering each file item from the file list in a page.
It helps to customize specific file item structure.
Declaration
public UploaderBuilder Rendering(string rendering)
Parameters
Type |
Name |
Description |
System.String |
rendering |
|
Returns
Fires if resume the paused chunk file upload.
Declaration
public UploaderBuilder Resuming(string resuming)
Parameters
Type |
Name |
Description |
System.String |
resuming |
|
Returns
Triggers after selecting or dropping the files by adding the files in upload queue.
Declaration
public UploaderBuilder Selected(string selected)
Parameters
Type |
Name |
Description |
System.String |
selected |
|
Returns
By default, the file uploader component is processing the multiple files simultaneously.
If sequentialUpload property is enabled, the file upload component performs the upload one after the other.
Declaration
public UploaderBuilder SequentialUpload(bool sequentialUpload = true)
Parameters
Type |
Name |
Description |
System.Boolean |
sequentialUpload |
|
Returns
Specifies a Boolean value that indicates whether the default file list can be rendered.
The property used to prevent default file list and design own template for file list.
Declaration
public UploaderBuilder ShowFileList(bool showFileList = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showFileList |
|
Returns
Triggers when the AJAX request gets success on uploading files or removing files.
Declaration
public UploaderBuilder Success(string success)
Parameters
Type |
Name |
Description |
System.String |
success |
|
Returns
Specifies the HTML string that used to customize the content of each file in the list.
Declaration
public UploaderBuilder Template(string template)
Parameters
Type |
Name |
Description |
System.String |
template |
|
Returns
Triggers when the upload process gets started. This event is used to add additional parameter with upload request.
Declaration
public UploaderBuilder Uploading(string uploading)
Parameters
Type |
Name |
Description |
System.String |
uploading |
|
Returns