-
Notifications
You must be signed in to change notification settings - Fork 140
AjaxFileUpload
AjaxFileUpload (demo)
AjaxFileUpload is an ASP.NET AJAX Control that allows you to asynchronously upload files to the server.
Name | Description |
---|---|
AllowedFileTypes | A comma-separated list of allowed file extensions. The default is an empty string. |
ChunkSize | The size of a chunk used by HTML5 to upload large files in bytes. The default is 4096. |
ClearFileListAfterUpload | Whether or not to hide file upload list container after the uploading finished |
IsInFileUploadPostBack | This will be true when a postback will be performed from the control. This can be used to avoid execution of unnecessary code during a partial postback. The default is false. |
MaximumNumberOfFiles | A maximum number of files in an upload queue. The default is 10. |
Mode | How AjaxFileUpload displays a progress bar. The default is Auto. |
OnClientUploadComplete | The name of a JavaScript function executed on the client side after a file is uploaded successfully. |
OnClientUploadCompleteAll | The client script that executes when all of files in queue uploaded, or when user hits Cancel button to stop uploading |
OnClientUploadError | The name of a JavaScript function executed on the client side if the file upload failed. |
OnClientUploadStart | The name of a JavaScript function executed on the client side before any files are uploaded. |
ServerPollingSupport | Whether or not AjaxFileUpload supports server polling. |
ThrobberID | The ID of a control that is shown on the file upload. The throbber image is displayed for browsers that do not support the HTML5 File API or server-side polling. |
UseAbsoluteHandlerPath | Whether or not to use absolute path for AjaxFileUploadHandler |
Name | Description |
---|---|
SaveAs(fileName) | Saves the uploaded file with the specified file name |
Name | Description |
---|---|
UploadComplete | An event raised when the file upload is complete. |
UploadCompleteAll | An event handler that will be raised when the UploadComplete event is raised in all files in an upload queue, or when a user presses the Cancel button to stop uploading. |
UploadStart | An event raised when the file upload starts. |
Name | Description |
---|---|
allowedFileTypes | A comma-separated list of allowed file extensions. |
chunkSize | The size of a chunk used by HTML5 to upload a large file in bytes. |
clearQueueContainerAfterUpload | Whether or not to hide the file upload list container after uploading finished |
maximumNumberOfFiles | A maximum number of files in an upload queue. Default value is 10. |
mode | How AjaxFileUpload displays a progress bar. |
postBackUrl | A url of the page where the control is located. |
serverPollingSupport | Whether or not AjaxFileUpload supports server polling. |
throbber | A control that is shown while a file is uploading. The throbber image is displayed for browsers that do not support the HTML5 File API or server-side polling. |
useAbsoluteHandlerPath | Whether or not to use absolute path for AjaxFileUploadHandler |
Name | Description |
---|---|
addFileToQueue(item) | The processor will call this method to add a selected file to the queue. It will return true if a file item is successfully added, otherwise, it returnes false. |
attachEvents(elements) | Attaches the click event hanlder to an upload button. |
cancelUpload() | Cancels upload process. |
confirmFileIsInvalid(fileItem) | Sends alert to a user that the file type is not acceptable. The processor uses this method after validation. |
done() | Call this method when all files has been uploaded. This method will reset states of the control. |
doneAndUploadNextFile(fileItem) | Marks fileItem as uploaded, and uploads the next file in a queue. |
enableControls(enable) | If set to true, it will set the control state to enabled (ready to upload), otherwise the control will be disabled and the button state turns to the Cancel button. |
fileTypeIsValid(fileType) | Checks whether the file type is allowed to be uploaded by checking it against the AlowedFileTypes property. |
getCurrentFileItem() | Gets a file item based on the current file id. |
getFileItem(id) | Get file in upload queue by ID |
getNextFile() | Gets a file in an upload queue by id. |
removeFileFromQueueHandler(e) | Removes a file from the queue and updates user interface. |
setAsUploading(fileItem) | Sets the file item status to uploading. |
setDefaultElementsLayout(elements) | Sets default elements layout during initializing. |
setFileStatus(fileItem, fileStatusText, text) | Sets file item status text. |
setPercent(percent) | Sets upload percentage. |
setStatusMessage(msg) | Sets a message in a status bar. |
Name | Description |
---|---|
uploadComplete | Occurs when the file upload completes. |
uploadCompleteAll | An event handler that will be raised when the UploadComplete event is raised in all files in an upload queue, or when a user presses the Cancel button to stop uploading. |
uploadError | An event handler raised when an upload error occurs. |
uploadStart | Occurs when the file upload starts |
A url of the page where the control is located.
Getter name: get_postBackUrl()
Setter name: set_postBackUrl(value)
How AjaxFileUpload displays a progress bar.
Getter name: get_mode()
Setter name: set_mode(value)
Whether or not AjaxFileUpload supports server polling.
Getter name: get_serverPollingSupport()
Setter name: set_serverPollingSupport(value)
A control that is shown while a file is uploading. The throbber image is displayed for browsers that do not support the HTML5 File API or server-side polling.
Getter name: get_throbber()
Setter name: set_throbber(value)
A maximum number of files in an upload queue. Default value is 10.
Getter name: get_maximumNumberOfFiles()
Setter name: set_maximumNumberOfFiles(value)
A comma-separated list of allowed file extensions.
Getter name: get_allowedFileTypes()
Setter name: set_allowedFileTypes(value)
The size of a chunk used by HTML5 to upload a large file in bytes.
Getter name: get_chunkSize()
Setter name: set_chunkSize(value)
Whether or not to use absolute path for AjaxFileUploadHandler
Getter name: get_useAbsoluteHandlerPath()
Setter name: set_useAbsoluteHandlerPath(value)
Whether or not to hide the file upload list container after uploading finished
Getter name: get_clearQueueContainerAfterUpload()
Setter name: set_clearQueueContainerAfterUpload(value)
Saves the uploaded file with the specified file name
Params:
-
fileName
- Type: String
- Description: Name of the file to save
Sets default elements layout during initializing.
Params:
-
elements
- Type: Object
- Description: Elements to set up
Attaches the click event hanlder to an upload button.
Params:
-
elements
- Type: Object
- Description: Collection of AjaxFileUpload visual elements
If set to true, it will set the control state to enabled (ready to upload), otherwise the control will be disabled and the button state turns to the Cancel button.
Params:
-
enable
- Type: Boolean
- Description: true to enable controls, otherwise false
Call this method when all files has been uploaded. This method will reset states of the control.
Removes a file from the queue and updates user interface.
Params:
-
e
- Type: Sys.Extended.UI.AjaxFileUpload.Item
- Description: An item to remove
The processor will call this method to add a selected file to the queue. It will return true if a file item is successfully added, otherwise, it returnes false.
Params:
-
item
- Type: Object
- Description: File to add to the queue
Checks whether the file type is allowed to be uploaded by checking it against the AlowedFileTypes property.
Params:
-
fileType
- Type: String
- Description: File extension
Sends alert to a user that the file type is not acceptable. The processor uses this method after validation.
Params:
-
fileItem
- Type: Object
- Description: File trying to be added to queue
Marks fileItem as uploaded, and uploads the next file in a queue.
Params:
-
fileItem
- Type: Object
- Description: Uploaded file
Cancels upload process.
Sets the file item status to uploading.
Params:
-
fileItem
- Type: Sys.Extended.UI.AjaxFileUpload.Item
- Description: Uploading file
Sets file item status text.
Params:
-
fileItem
- Type: Sys.Extended.UI.AjaxFileUpload.Item
- Description: Uploading file
-
fileStatusText
- Type: String
- Description: Text displayed in file info container
-
text
- Type: String
- Description: Text displayed in status bar
Sets a message in a status bar.
Params:
-
msg
- Type: String
- Description: Text to set
Sets upload percentage.
Params:
-
percent
- Type: Number
- Description: Upload percent
Gets a file item based on the current file id.
Gets a file in an upload queue by id.
Get file in upload queue by ID
Params:
-
id
- Type: Number
- Description: File ID
Occurs when the file upload starts
Add event handler method: add_uploadStart(handler)
Remove event handler method: remove_uploadStart(handler)
Raise event method: raise_uploadStart()
Occurs when the file upload completes.
Add event handler method: add_uploadComplete(handler)
Remove event handler method: remove_uploadComplete(handler)
Raise event method: raise_uploadComplete()
An event handler that will be raised when the UploadComplete event is raised in all files in an upload queue, or when a user presses the Cancel button to stop uploading.
Add event handler method: add_uploadCompleteAll(handler)
Remove event handler method: remove_uploadCompleteAll(handler)
Raise event method: raise_uploadCompleteAll()
An event handler raised when an upload error occurs.
Add event handler method: add_uploadError(handler)
Remove event handler method: remove_uploadError(handler)
Raise event method: raise_uploadError()
This content was moved from https://ajaxcontroltoolkit.codeplex.com/documentation to this Documentation wiki. This is now the authoritative location of the AJAX Control Toolkit documentation.
- Step-by-Step Installation Guide
- Upgrading from v7.x and below
- Uninstalling the AJAX Control Toolkit
- Troubleshooting Installer Issues
- Updating the Project from CI Builds
- How to Use Bundling and CDN
- Creating a Custom Localization
- Creating a Custom Control
- Design Standards
Controls:
- Accordion
- AjaxFileUpload
- AreaChart
- AsyncFileUpload
- BarChart
- BubbleChart
- ComboBox
- Editor (deprecated)
- Gravatar
- LineChart
- NoBot
- PieChart
- Rating
- ReorderList
- Seadragon
- TabContainer
- TabPanel
Extenders:
- AlwaysVisibleControl
- Animation
- AutoComplete
- BalloonPopup
- Calendar
- CascadingDropDown
- CollapsiblePanel
- ColorPicker
- ConfirmButton
- DragPanel
- DropDown
- DropShadow
- DynamicPopulate
- FilteredTextBox
- HoverMenu
- HtmlEditor
- ListSearch
- MaskedEdit
- MaskedEditValidator
- ModalPopup
- MultiHandleSlider
- MutuallyExclusiveCheckBox
- NumericUpDown
- PagingBulletedList
- PasswordStrength
- PopupControl
- ResizableControl
- RoundedCorners
- Slider
- SlideShow
- TextBoxWatermark
- ToggleButton
- UpdatePanelAnimation
- ValidatorCallout