DXUploadControl
- 3 minutes to read
The UploadControl allows end-users to upload one or more files to the web application's server. The control provides numerous settings, allowing you to specify the maximum number of files that can be uploaded at a time, the maximum size of a file or all files, package size, file filter, etc.
#Server Settings
The UploadControl requires its server settings to be specified. These settings include:
- a Web Handler URI (UploadControl.WebHandlerUri);
- a target path on the server where the files should be saved, specified by the UploadControl.UploadServerPath property.
For a tutorial describing how to implement DXUploadControl's server side, see Server-Side Upload Service.
#Upload Settings
- File Filter filters' file names displayed in the file open dialog, specified by the UploadControl.FileNameFilter property;
- The maximum number of files that can be uploaded at a time is specified by the UploadControl.MaxFileCount property;
The maximum sizes of a file and all files are specified by the UploadControl.MaxFileSize and UploadControl.MaxUploadSize properties, respectively; if any of these limits are exceeded, the UploadControl displays an error message.
- Automatic file uploading. If the UploadControl.IsAutomaticUpload property is set to true, the UploadControl starts uploading a file automatically after it has been added.
#End-User Capabilities
Add files; to do this an end-user should click the empty upload item; to add a new file in code, use the UploadControl.AddFile method.
- Remove files; to do this an end-user should click the Close button displayed within an upload item.
- Start, suspend, resume or stop file uploading. The corresponding API: UploadControl.StartUpload, UploadControl.PauseUpload, UploadControl.ResumeUpload and UploadControl.StopUpload.
#Event Notification
Before starting an upload, the UploadControl fires the UploadControl.BeforeStartUpload event.
During an upload, the UploadControl displays the total upload progress bar with individual progress bars displayed within every upload item. After a single file has been uploaded, the UploadControl.FileUploadCompleted event is fired. When the entire upload is completed, the UploadControl.TotalUploadCompleted event is fired. The UploadControl.UploadItemRemoved event is fired after an upload of a single file has been canceled. After a whole upload has been canceled, the UploadControl.UploadCancelled event is fired.
If an error occurs during an upload, the UploadControl.UploadError event is raised.
#Preview Images
The UploadControl allows you to show preview images within its items.
Use the UploadControl.ShowPreviewImage method when handling the UploadControl.FileUploadCompleted or UploadControl.UploadItemRemoved event to show an image within a particular item. You can also apply a bitmap effect to the preview image via the UploadControl.SetUploadItemEffect method.