# UploadBuilder

## Properties

### WriteAction - Func

## Methods

### Enable(System.Boolean)

Enables or disables the Upload component.

#### Parameters

##### value - `System.Boolean`

### Messages(System.Action)

Sets the strings rendered by the Upload.

#### Parameters

##### configurator - System.Action<[UploadMessagesSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadmessagessettingsbuilder)>

The configurator for the localization setting.

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

### Async(System.Action)

Configures the asynchronous upload of files. For more details, refer to the article on the async mode of the Upload.

#### Parameters

##### configurator - System.Action<[UploadAsyncSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadasyncsettingsbuilder)>

The configurator for the async setting.

#### RETURNS

Returns the current instance of [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) .

### Directory(System.Boolean)

Enables the selection of folders instead of files. When the user selects a directory, its entire content hierarchy of files is included in the set of selected items. The directory setting is available only in browsers which support webkitdirectory.

#### Parameters

##### value - `System.Boolean`

The value for Directory

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Upload()
                        .Name("Upload")
                        .Directory(true)
            )
             
```

### Directory()

Enables the selection of folders instead of files. When the user selects a directory, its entire content hierarchy of files is included in the set of selected items. The directory setting is available only in browsers which support webkitdirectory.

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Upload()
                        .Name("Upload")
                        .Directory(true)
            )
             
```

### DirectoryDrop(System.Boolean)

Enables the dropping of folders over the Upload and its drop zone. When a directory is dropped, its entire content hierarchy of files is included in the set of selected items. The directoryDrop setting is available only in browsers which support DataTransferItem and webkitGetAsEntry.

#### Parameters

##### value - `System.Boolean`

The value for DirectoryDrop

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Upload()
                        .Name("Upload")
                        .DirectoryDrop(true)
            )
             
```

### DirectoryDrop()

Enables the dropping of folders over the Upload and its drop zone. When a directory is dropped, its entire content hierarchy of files is included in the set of selected items. The directoryDrop setting is available only in browsers which support DataTransferItem and webkitGetAsEntry.

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Upload()
                        .Name("Upload")
                        .DirectoryDrop(true)
            )
             
```

### DropZone(System.String)

Initializes a drop-zone element based on a given selector, which provides the drag-and-drop file upload.

#### Parameters

##### value - `System.String`

The value for DropZone

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Upload()
                        .Name("Upload")
                        .DropZone("DropZone")
                        .Async(async => async
                            .Save("Save", "Home")
                            .Remove("Remove", "Home")
                        )
            )
             
```

### Files(System.Action)

The list of files that will be initially rendered in the files list of the Upload.Each file object in the array has to contain the following properties: name; size or extension.

#### Parameters

##### configurator - System.Action<[UploadFileFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadfilefactory)>

The configurator for the files setting.

#### RETURNS

Returns the current instance of [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) .

### Multiple(System.Boolean)

Enables (if set to true) or disables (if set to false) the selection of multiple files. If set to false, the user can select only one file at a time.

#### Parameters

##### value - `System.Boolean`

The value for Multiple

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Upload()
                        .Name("Upload")
                        .Multiple(false)
            )
             
```

### ShowFileList(System.Boolean)

Enables (if set to true) or disables (if set to false) the display of a file listing for the file upload. The disabling of a file listing might be useful if you want to customize the UI. To build your own UI, use the client-side events.

#### Parameters

##### value - `System.Boolean`

The value for ShowFileList

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Upload()
                        .Name("Upload")
                        .ShowFileList(false)
            )
             
```

### Template(System.String)

Sets a template for rendering the files in the file list.The template data Array consists of: name - The name of the file. If in batch upload mode, represents a string combination of all file names separated with comma.; size - The file size in bytes. If in batch upload mode, represents the total file size. If not available, the value is null. or files - An array which contains information about all selected files (name, size, and extension)..

#### Parameters

##### value - `System.String`

The value for Template

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @(Html.Kendo().Upload()
                        .Name("Upload")
                        .Template(Html.Kendo().Template().AddHtml("<div class='file-wrapper'><h4 class='file-heading file-name-heading'>Name: ${data.name}</h4></div>"))
                        .Async(async => async
                            .Save("Save", "Home")
                            .Remove("Remove", "Home")
                        )
            )
             
```

### TemplateId(System.String)

Sets a template for rendering the files in the file list.The template data Array consists of: name - The name of the file. If in batch upload mode, represents a string combination of all file names separated with comma.; size - The file size in bytes. If in batch upload mode, represents the total file size. If not available, the value is null. or files - An array which contains information about all selected files (name, size, and extension)..

#### Parameters

##### templateId - `System.String`

The ID of the template element for Template

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @(Html.Kendo().Upload()
                        .Name("Upload")
                        .TemplateId("fileTemplate")
                        .Async(async => async
                            .Save("Save", "Home")
                            .Remove("Remove", "Home")
                        )
            )
             
```

### TemplateView(Microsoft.AspNetCore.Html.IHtmlContent)

Sets a template for rendering the files in the file list.The template data Array consists of: name - The name of the file. If in batch upload mode, represents a string combination of all file names separated with comma.; size - The file size in bytes. If in batch upload mode, represents the total file size. If not available, the value is null. or files - An array which contains information about all selected files (name, size, and extension)..

#### Parameters

##### templateView - `Microsoft.AspNetCore.Html.IHtmlContent`

The view that contains the template for Template

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Upload()
                        .Name("Upload")
                        .TemplateView(Html.Partial("TemplateView"))
                        .Async(async => async
                            .Save("Save", "Compose")
                            .Remove("Remove", "Compose")
                        )
            )
             
```

### TemplateHandler(System.String)

Sets a template for rendering the files in the file list.The template data Array consists of: name - The name of the file. If in batch upload mode, represents a string combination of all file names separated with comma.; size - The file size in bytes. If in batch upload mode, represents the total file size. If not available, the value is null. or files - An array which contains information about all selected files (name, size, and extension)..

#### Parameters

##### templateHandler - `System.String`

The handler that returs the template for Template

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @(Html.Kendo().Upload()
                        .Name("Upload")
                        .TemplateHandler("fileTemplate")
                        .Async(async => async
                            .Save("Save", "Home")
                            .Remove("Remove", "Home")
                        )
            )
             
```

### Template(Kendo.Mvc.UI.Fluent.TemplateBuilder)

Sets a template for rendering the files in the file list.The template data Array consists of: name - The name of the file. If in batch upload mode, represents a string combination of all file names separated with comma.; size - The file size in bytes. If in batch upload mode, represents the total file size. If not available, the value is null. or files - An array which contains information about all selected files (name, size, and extension)..

#### Parameters

##### template - TemplateBuilder\<TModel>

A Template component that configures the template.

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

### Validation(System.Action)

Configures the validation options for uploaded files.

#### Parameters

##### configurator - System.Action<[UploadValidationSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadvalidationsettingsbuilder)>

The configurator for the validation setting.

#### RETURNS

Returns the current instance of [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) .

### Events(System.Action)

Configures the client-side events.

#### Parameters

##### configurator - System.Action<[UploadEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadeventbuilder)>

The client events action.

#### RETURNS

Returns the current [UploadBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/uploadbuilder) instance.

#### Example

```
 
            @(Html.Kendo().Upload()
                  .Name("Upload")
                  .Events(events => events
                      .Cancel("onCancel")
                  )
            )
             
```

### UseMvvmInitialization(System.Boolean)

Specifies if the component should be initialized through MVVM on the client.

#### Parameters

##### value - `System.Boolean`

The value.

#### RETURNS

Returns the current  instance.

### UseMvvmInitialization()

Specifies if the component should be initialized through MVVM on the client.

#### RETURNS

Returns the current  instance.

### ToComponent()

Returns the internal view component.

#### RETURNS

The  instance that represents the component.

### Expression(System.String)

Sets the name of the component.

#### Parameters

##### modelExpression - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

#### Parameters

##### modelExplorer - `Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer`

The name.

#### RETURNS

Returns the current  instance.

### Name(System.String)

Sets the name of the component.

#### Parameters

##### componentName - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean,System.Boolean)

#### Parameters

##### deferred - `System.Boolean`

#### RETURNS

Returns a [DeferredWidgetBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/deferredwidgetbuilder) instance.

### HtmlAttributes(System.Object)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Object`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Object`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### Render()

Renders the component in place.

### ToHtmlString()

Returns the HTML representation of the component.

### WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

#### Parameters

##### writer - `System.IO.TextWriter`

##### encoder - `System.Text.Encodings.Web.HtmlEncoder`

### ToClientTemplate()

Returns the client template for the component.

### AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

#### Parameters

##### value - `System.Boolean`

#### RETURNS

Returns the current  instance.
