Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

AsyncFileUpload

MikhailTymchukDX edited this page Apr 12, 2017 · 4 revisions

Demo Page

AsyncFileUpload is an ASP.NET AJAX Control that allows you to asynchronously upload files to the server. The file uploading results can be checked both on the server and client sides.

Properties

Name Description
CompleteBackColor The control's background color on upload complete. The default value is Lime.
ContentType Gets the name of a file on the client that is uploaded using the control.
ErrorBackColor The control's background color on an upload error. The default value is Red.
FailedValidation Whether validation is failed
FileBytes Uploaded file bytes
FileContent Gets a Stream object that points to an uploaded file to prepare for reading the content of the file.
FileName Gets the name of a file on the client that is uploaded using the control.
HasFile A bool value indicating whether the control contains a file
IsUploading Whether a file is being uploaded.
OnClientUploadComplete The name of a javascript function executed on the client side after a file is successfully uploaded.
OnClientUploadError The name of a javascript function executed on the client side if the file upload failed.
OnClientUploadStarted The name of a javascript function executed on the client side if the file upload started.
PersistFile Whether a file is stored in session. The default value is false.
PostedFile A HttpPostedFile object that provides access to the uploaded file
ThrobberID ID of a control that is shown while the file is being uploaded.
UploaderStyle The control's appearance style (Traditional, Modern). The default value is Traditional.
UploadingBackColor The control's background color when uploading is in progress. The default value is White.
Width The control's width (Unit). The default value is 355px.

Methods

Name Description
ClearAllFilesFromPersistedStore() Clears all uploaded files of a current control from session.
ClearFileFromPersistedStore() Clears all uploaded files of current control from session
SaveAs(fileName) Saves the content of an uploaded file.

Events

Name Description
UploadedComplete Fires when the file is successfully uploaded.
UploadedFileError Fires when the uploaded file is corrupted.

Client properties

Name Description
completeBackColor The control's background color on upload complete. The default value - 'Lime'.
errorBackColor The control's background color on upload error. The default value - 'Red'.
formName A name of the form.
hiddenField Stores the file path.
innerTB An inner throbber.
inputFile Inputs an element with type='file'.
postBackUrl Url that receives posted data relative to the form.
throbber The control that is shown while the file is being uploaded.
uploadingBackColor The control's background color when uploading is in progress. The default value - 'White'.

Client methods

Name Description
setThrobber(value) Set throbber visual style

Client events

Name Description
uploadComplete Occurs when file uploading is completed.
uploadError Fires when file uploading encounters an error
uploadStarted Occurs when file uploading starts.

Client properties

completeBackColor

The control's background color on upload complete. The default value - 'Lime'.

Getter name: get_completeBackColor()
Setter name: set_completeBackColor(value)

errorBackColor

The control's background color on upload error. The default value - 'Red'.

Getter name: get_errorBackColor()
Setter name: set_errorBackColor(value)

formName

A name of the form.

Getter name: get_formName()
Setter name: set_formName(value)

hiddenField

Stores the file path.

Getter name: get_hiddenField()
Setter name: set_hiddenField(value)

innerTB

An inner throbber.

Getter name: get_innerTB()
Setter name: set_innerTB(value)

inputFile

Inputs an element with type='file'.

Getter name: get_inputFile()
Setter name: set_inputFile(value)

postBackUrl

Url that receives posted data relative to the form.

Getter name: get_postBackUrl()
Setter name: set_postBackUrl(value)

throbber

The control that is shown while the file is being uploaded.

Getter name: get_throbber()
Setter name: set_throbber(value)

uploadingBackColor

The control's background color when uploading is in progress. The default value - 'White'.

Getter name: get_uploadingBackColor()
Setter name: set_uploadingBackColor(value)

Methods

ClearAllFilesFromPersistedStore()

Clears all uploaded files of a current control from session.

ClearFileFromPersistedStore()

Clears all uploaded files of current control from session

SaveAs(fileName)

Saves the content of an uploaded file.

Params:

  • fileName
    • Type: String
    • Description: Uploaded file name

Client methods

setThrobber(value)

Set throbber visual style

Params:

  • value
    • Type: String
    • Description: Visual style value

Client events

uploadComplete

Occurs when file uploading is completed.

Add event handler method: add_uploadComplete(handler)
Remove event handler method: remove_uploadComplete(handler)
Raise event method: raise_uploadComplete()

uploadError

Fires when file uploading encounters an error

Add event handler method: add_uploadError(handler)
Remove event handler method: remove_uploadError(handler)
Raise event method: raise_uploadError()

uploadStarted

Occurs when file uploading starts.

Add event handler method: add_uploadStarted(handler)
Remove event handler method: remove_uploadStarted(handler)
Raise event method: raise_uploadStarted()

Clone this wiki locally