Skip to content
This repository was 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

NameDescription
CompleteBackColorThe control's background color on upload complete. The default value is Lime.
ContentTypeGets the name of a file on the client that is uploaded using the control.
ErrorBackColorThe control's background color on an upload error. The default value is Red.
FailedValidationWhether validation is failed
FileBytesUploaded file bytes
FileContentGets a Stream object that points to an uploaded file to prepare for reading the content of the file.
FileNameGets the name of a file on the client that is uploaded using the control.
HasFileA bool value indicating whether the control contains a file
IsUploadingWhether a file is being uploaded.
OnClientUploadCompleteThe name of a javascript function executed on the client side after a file is successfully uploaded.
OnClientUploadErrorThe name of a javascript function executed on the client side if the file upload failed.
OnClientUploadStartedThe name of a javascript function executed on the client side if the file upload started.
PersistFileWhether a file is stored in session. The default value is false.
PostedFileA HttpPostedFile object that provides access to the uploaded file
ThrobberIDID of a control that is shown while the file is being uploaded.
UploaderStyleThe control's appearance style (Traditional, Modern). The default value is Traditional.
UploadingBackColorThe control's background color when uploading is in progress. The default value is White.
WidthThe control's width (Unit). The default value is 355px.

Methods

NameDescription
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

NameDescription
UploadedCompleteFires when the file is successfully uploaded.
UploadedFileErrorFires when the uploaded file is corrupted.

Client properties

NameDescription
completeBackColorThe control's background color on upload complete. The default value - 'Lime'.
errorBackColorThe control's background color on upload error. The default value - 'Red'.
formNameA name of the form.
hiddenFieldStores the file path.
innerTBAn inner throbber.
inputFileInputs an element with type='file'.
postBackUrlUrl that receives posted data relative to the form.
throbberThe control that is shown while the file is being uploaded.
uploadingBackColorThe control's background color when uploading is in progress. The default value - 'White'.

Client methods

NameDescription
setThrobber(value)Set throbber visual style

Client events

NameDescription
uploadCompleteOccurs when file uploading is completed.
uploadErrorFires when file uploading encounters an error
uploadStartedOccurs 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