Skip to main content
Version: 4.1

Upload

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represent an upload widget. Allows users to selected one or more files and upload them to the server.

public class Upload : Control, IWisejHandler, IValidation

Constructors​

Instance member Upload()​

Initializes a new instance of Upload.

Properties​

Instance member AllowedFileTypes​

String: Specify the types of files that the server accepts (that can be submitted through a file upload). (Default: "")

The allowed files string follows the HTML 4.01 and HTML5 specifications. You can configure only one entry in the browser's file dialog. The syntax is "file_extension|audio/|video/|image/*|media_type" where

  • file_extension A file extension starting with the dot, e.g: .gif, .jpg, .png, .doc.
  • audio/* All sound files are accepted
  • video/* All video files are accepted
  • image/* All image files are accepted
  • media_type A valid media type, with no parameters. Look at IANA Media Types for a complete list of standard media types.

Instance member AllowFolders​

Boolean: Returns or sets whether the upload control allows the selection of a directory for upload. (Default: False)

Instance member AllowMultipleFiles​

Boolean: Returns or sets whether the upload control allows the selection of multiple files. (Default: False)

Instance member ButtonPosition​

ContentAlignment: Returns or sets the position of the upload button relative to the value field.. (Default: MiddleRight)

Instance member CaptureMode​

CaptureMode: Returns or sets a value that specifies which camera to use for capture of image or video data, if the AllowedFileTypes property indicates that the input should be of one of those types. (Default: Default)

Protected member DefaultSize​

Size:

Instance member HideValue​

Boolean: Returns or sets whether the value field is visible. (Default: False)

Instance member Image​

Image: Returns or sets the icon that is displayed in the upload button in the Upload control.

Instance member ImageSource​

String: Returns or sets the theme name or URL for the icon to display in the upload button in the Upload control.

Instance member Invalid​

Boolean: Returns or sets a value that indicates that the control is invalid.

Instance member InvalidMessage​

String: Returns or sets the invalid message that is shown in the invalid tooltip. (Default: "")

Instance member MaxFileSize​

Int32: Returns or sets the maximum file size in bytes. (Default: 0)

Throws:

Instance member ShowLoader​

Boolean: Returns or sets whether the upload control shows a the ajax-loader image when uploading the file(s). (Default: True)

Instance member Text​

String: Returns or sets the text associated with this control. (Default: "")

Instance member TextAlign​

ContentAlignment: Returns or sets the alignment of the text on the button control. (Default: MiddleCenter)

Instance member Value​

String: Returns or sets the text to display in the text fields part of the control. (Default: "")

Methods​

Instance member Abort()​

Aborts the current upload request, if in progress.

Protected member OnError(e)​

Fires the Error event.

ParameterTypeDescription
eUploadErrorEventArgsA UploadErrorEventArgs that contains the event data.

Protected member OnProgress(e)​

Fires the Progress event.

ParameterTypeDescription
eUploadProgressEventArgsA UploadProgressEventArgs that contains the event data.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Protected member OnUploaded(e)​

Fires the Uploaded event.

ParameterTypeDescription
eUploadedEventArgsA UploadedEventArgs that contains the event data.

Protected member OnUploading(e)​

Fires the Uploading event.

ParameterTypeDescription
eUploadingEventArgsA UploadingEventArgs that contains the event data.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Protected member OnValueChanged(e)​

Fires the ValueChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnWebEvent(e)​

Processes the event from the client.

ParameterTypeDescription
eWisejEventArgsEvent arguments.

Protected member OnWebRender(config)​

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Instance member UploadFiles()​

Opens the file selection dialog and uploads the files selected by the user.

Events​

Instance member Error​

UploadErrorEventHandler Fired when the Upload control generates an upload error.

Instance member Progress​

UploadProgressEventHandler Fired while the Upload control receives the data being uploaded.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Instance member Uploaded​

UploadedEventHandler Fired when files are uploaded to the Upload control.

Instance member Uploading​

UploadingEventHandler Fired before the Upload control received the files being uploaded.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

You can abort the uploading process by setting e.Cancel = true in the event handler.

Instance member ValueChanged​

EventHandler Fired when the user has selected the files to upload.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IValidationProvides access to the validation events and properties property for controls that support validation.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejHandlerRepresents a Wisej component that is capable of handling postback requests from the client.
IWisejSerializableAllows an object to serialize itself.