New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring UploadAsyncSettings

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class UploadAsyncSettingsBuilder

Inheritance: objectUploadAsyncSettingsBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

UploadAsyncSettingsBuilder method.

C#
public UploadAsyncSettingsBuilder(UploadAsyncSettings container)
Parameters:containerUploadAsyncSettings

Properties

Gets the settings being configured.

C#
protected UploadAsyncSettings Container { get; }

Methods

If async.autoRetryAfter is set, the failed upload request is repeated after the declared amount of time in miliseconds.

C#
public UploadAsyncSettingsBuilder AutoRetryAfter(double value)
Parameters:valuedouble

The value for AutoRetryAfter

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Save("Save", "Home")
.AutoRetryAfter(300)
)
)

By default, the selected files are uploaded immediately. To change this behavior, set autoUpload to false.

C#
public UploadAsyncSettingsBuilder AutoUpload(bool value)
Parameters:valuebool

The value for AutoUpload

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Save("Save", "Home", new RouteValueDictionary{ {"id", 1} })
)
)

By default and if supported by the browser, the selected files are uploaded in separate requests. To change this behavior, set batch to true. As a result, all selected files are uploaded in one request.The batch mode applies to multiple files which are selected simultaneously. Files that are selected one after the other are uploaded in separate requests.

C#
public UploadAsyncSettingsBuilder Batch()
Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

By default and if supported by the browser, the selected files are uploaded in separate requests. To change this behavior, set batch to true. As a result, all selected files are uploaded in one request.The batch mode applies to multiple files which are selected simultaneously. Files that are selected one after the other are uploaded in separate requests.

C#
public UploadAsyncSettingsBuilder Batch(bool value)
Parameters:valuebool

The value for Batch

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Save("Save", "Home")
.Batch(true)
)
)

When async.chunkSize is set, the selected files are uploaded chunk by chunk with the declared size. Each request sends a separate file blob and additional string metadata to the server. This metadata is in a stringified JSON format and contains the fileName, relativePath, chunkIndex, contentType, totalFileSize, totalChunks, and uploadUid properties. These properties enable the validation and combination of the file on the server side. The response also returns a JSON object with the uploaded and fileUid properties, which notifies the client what the next chunk is.

C#
public UploadAsyncSettingsBuilder ChunkSize(double value)
Parameters:valuedouble

The value for ChunkSize

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Save("Chunk_Upload_Save", "Home")
.Remove("Chunk_Upload_Remove", "Home")
.ChunkSize(11000)
)
)

By default, the selected files are uploaded one after the other. When async.concurrent is set to true, all selected files start to upload simultaneously.

C#
public UploadAsyncSettingsBuilder Concurrent()
Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

By default, the selected files are uploaded one after the other. When async.concurrent is set to true, all selected files start to upload simultaneously.

C#
public UploadAsyncSettingsBuilder Concurrent(bool value)
Parameters:valuebool

The value for Concurrent

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Save("Chunk_Upload_Save", "Home")
.ChunkSize(11000)
.Concurrent()
)
)

Sets the maximum number of attempts that are performed if an upload fails.

C#
public UploadAsyncSettingsBuilder MaxAutoRetries(double value)
Parameters:valuedouble

The value for MaxAutoRetries

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Save("Save", "Home")
.AutoRetryAfter(300)
.MaxAutoRetries(4)
)
)

Sets the route values for the remove operation

C#
public UploadAsyncSettingsBuilder Remove(RouteValueDictionary routeValues)
Parameters:routeValuesRouteValueDictionary

The route values of the action method.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Remove(MVC.Home.Remove(1).GetRouteValueDictionary())
)
)

Sets the route and values for the remove operation

C#
public UploadAsyncSettingsBuilder Remove(string routeName, object routeValues)
Parameters:routeNamestring

Name of the route.

routeValuesobject

The route values.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Remove("Default", new { id = 1 })
)
)

Sets the route and values for the remove operation

C#
public UploadAsyncSettingsBuilder Remove(string routeName, RouteValueDictionary routeValues)
Parameters:routeNamestring

Name of the route.

routeValuesRouteValueDictionary

The route values.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Remove("Default", new RouteValueDictionary{ {"id", 1} })
)
)

Sets the action, controller and route values for the remove operation

C#
public UploadAsyncSettingsBuilder Remove(string actionName, string controllerName, object routeValues)
Parameters:actionNamestring

Name of the action.

controllerNamestring

Name of the controller.

routeValuesobject

The route values.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Remove("Remove", "Home", new { id = 1 })
)
)

Sets the action, controller and route values for the remove operation

C#
public UploadAsyncSettingsBuilder Remove(string actionName, string controllerName, RouteValueDictionary routeValues)
Parameters:actionNamestring

Name of the action.

controllerNamestring

Name of the controller.

routeValuesRouteValueDictionary

The route values.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Remove("Remove", "Home", new RouteValueDictionary{ {"id", 1} })
)
)

Sets the action and controller for the remove operation

C#
public UploadAsyncSettingsBuilder Remove(string actionName, string controllerName)
Parameters:actionNamestring

Name of the action.

controllerNamestring

Name of the controller.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Remove("Remove", "Home")
)
)

Sets the route name for the remove operation

C#
public UploadAsyncSettingsBuilder Remove(string routeName)
Parameters:routeNamestring

Name of the route.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async => async
.Remove("Default")
)
)

Sets the action for the remove operation

C#
public UploadAsyncSettingsBuilder Remove<TController>(Expression<Action<TController>> controllerAction) where TController : Controller
Parameters:controllerActionExpression<Action<TController>>

The action.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.Remove&lt;HomeController&gt;(controller =&gt; controller.Remove())
)
)

The name of the form field that is submitted to removeUrl.

C#
public UploadAsyncSettingsBuilder RemoveField(string value)
Parameters:valuestring

The value for RemoveField

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.RemoveField("attachments")
)
)

The URL of the handler which is responsible for the removal of the uploaded files (if any). The handler must accept POST requests with one or more "fileNames" fields which specify the files that will be deleted.

C#
public UploadAsyncSettingsBuilder RemoveUrl(string value)
Parameters:valuestring

The value for RemoveUrl

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.RemoveUrl("/remove")
)
)

The HTTP verb that will be used by the remove action.

C#
public UploadAsyncSettingsBuilder RemoveVerb(string value)
Parameters:valuestring

The value for RemoveVerb

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Sets the route values for the save operation

C#
public UploadAsyncSettingsBuilder Save(RouteValueDictionary routeValues)
Parameters:routeValuesRouteValueDictionary

The route values of the action method.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.Save(MVC.Home.Save(1).GetRouteValueDictionary())
)
)

Sets the route and values for the save operation

C#
public UploadAsyncSettingsBuilder Save(string routeName, object routeValues)
Parameters:routeNamestring

Name of the route.

routeValuesobject

The route values.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.Save("Default", new { id = 1 })
)
)

Sets the route and values for the save operation

C#
public UploadAsyncSettingsBuilder Save(string routeName, RouteValueDictionary routeValues)
Parameters:routeNamestring

Name of the route.

routeValuesRouteValueDictionary

The route values.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.Save("Default", new RouteValueDictionary{ {"id", 1} })
)
)

Sets the action, controller and route values for the save operation

C#
public UploadAsyncSettingsBuilder Save(string actionName, string controllerName, object routeValues)
Parameters:actionNamestring

Name of the action.

controllerNamestring

Name of the controller.

routeValuesobject

The route values.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.Save("Save", "Home", new { id = 1 })
)
)

Sets the action, controller and route values for the save operation

C#
public UploadAsyncSettingsBuilder Save(string actionName, string controllerName, RouteValueDictionary routeValues)
Parameters:actionNamestring

Name of the action.

controllerNamestring

Name of the controller.

routeValuesRouteValueDictionary

The route values.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.Save("Save", "Home", new RouteValueDictionary{ {"id", 1} })
)
)

Sets the action and controller for the save operation

C#
public UploadAsyncSettingsBuilder Save(string actionName, string controllerName)
Parameters:actionNamestring

Name of the action.

controllerNamestring

Name of the controller.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.Save("Save", "Home")
)
)

Sets the route name for the save operation

C#
public UploadAsyncSettingsBuilder Save(string routeName)
Parameters:routeNamestring

Name of the route.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.Save("Default")
)
)

Sets the action for the save operation

C#
public UploadAsyncSettingsBuilder Save<TController>(Expression<Action<TController>> controllerAction) where TController : Controller
Parameters:controllerActionExpression<Action<TController>>

The action.

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.Save&lt;HomeController&gt;(controller =&gt; controller.Save())
)
)

The name of the form field which is submitted to saveUrl. The default value is the input name.

C#
public UploadAsyncSettingsBuilder SaveField(string value)
Parameters:valuestring

The value for SaveField

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.SaveField("attachment")
)
)

The URL of the handler that will receive the submitted files. The handler must accept POST requests which contain one or more fields with the same name as the original input name.

C#
public UploadAsyncSettingsBuilder SaveUrl(string value)
Parameters:valuestring

The value for SaveUrl

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.SaveUrl("/save")
)
)

By default, the files are uploaded as file data. When set to true, the files are read as a file buffer by using FileReader. This buffer is sent in the request body.

C#
public UploadAsyncSettingsBuilder UseArrayBuffer()
Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

By default, the files are uploaded as file data. When set to true, the files are read as a file buffer by using FileReader. This buffer is sent in the request body.

C#
public UploadAsyncSettingsBuilder UseArrayBuffer(bool value)
Parameters:valuebool

The value for UseArrayBuffer

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.Save("Save", "Home")
.UseArrayBuffer(true)
)
)

Controls whether to send credentials (cookies, headers) for cross-site requests.

C#
public UploadAsyncSettingsBuilder WithCredentials(bool value)
Parameters:valuebool

The value for WithCredentials

Returns:

UploadAsyncSettingsBuilder

Returns the current UploadAsyncSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Upload()
.Name("Upload")
.Async(async =&gt; async
.WithCredentials(false)
)
)