Click or drag to resize

FileUploaderControl Class

The control for uploading files and folders.
Inheritance Hierarchy
SystemObject
  System.Web.UIControl
    System.Web.UI.WebControlsWebControl
      ComponentControlFileUploader
        StatefulComponentControlFileUploader
          GleamTech.FileUltimate.AspNet.WebFormsFileUploaderControl

Namespace:  GleamTech.FileUltimate.AspNet.WebForms
Assembly:  GleamTech.FileUltimate (in GleamTech.FileUltimate.dll) Version: 7.9.1
Syntax
public sealed class FileUploaderControl : StatefulComponentControl<FileUploader>

The FileUploaderControl type exposes the following members.

Constructors
  NameDescription
Public methodFileUploaderControl
Initializes a new instance of the FileUploaderControl class.
Public methodFileUploaderControl(FileUltimateWebConfiguration)
Initializes a new instance of the FileUploaderControl class with custom web configuration.
Public methodFileUploaderControl(FileUploader)
Initializes a new instance of the FileUploaderControl class with an existing FileUploader component instance.
Top
Properties
  NameDescription
Public propertyAllowedFileTypes
Gets or sets the file patterns that are allowed to be uploaded. If not set, any file type is allowed ("*"). When combining patterns in string representation, they should be separated by vertical bar (|).

In a pattern, you can use these wildcards:

  • * matches zero or more characters.
  • ? matches exactly one character.

Some pattern examples:

  • *.* matches files with any extension (does not match files without an extension)
  • *.jpg matches files only with jpg extension
  • picture*.jpg matches files only with jpg extension and which names start with 'picture'
  • picture.* matches files with any extension and which names start with 'picture'
  • picture matches files with no extension and which names are exactly 'picture'
  • *.jp* matches files like 'picture.jpg', 'otherpicture.jpe', 'somepicture.jpeg' etc.
  • *.jp? matches files like 'picture.jpg', 'otherpicture.jpe' etc.
  • picture?.jpg matches files like 'picture1.jpg', 'picture2.jpg', 'pictures.jpg' etc.

Public propertyAutoClose
Gets or sets a value that specifies whether FileUploader closes itself automatically when the upload is successful. The default is false. Note that auto-closing will be canceled if one or more items fails, this allows the user to click "status reason" and examine the problem.
Public propertyAutoStart
Gets or sets a value that specifies whether FileUploader starts uploading automatically after any files are added to the upload queue (user does not need to click "Upload" button). The default is false.
Public propertyChunkSize
Gets or sets the chunk size used in chunk uploading mode. The default is determined from system.webServer/requestLimits/maxAllowedContentLength property in Web.Config and is usually 28.6 MB. FileUploader automatically overrides runtime request limits for ASP.NET Classic 4.5+ and ASP.NET Core but it's limited by IIS (system.webServer) request limits.

In chunk uploading mode, file is split into chunks and uploaded part by part, and then reassembled back on the server. The reason for using chunk uploading when possible, is to overcome server's default request limitations. By using chunking, normally you don't need to change any settings to allow uploading of very large files out of the box.

Currently all upload methods except Html4 uses chunk uploading, this is because Html4 cannot split into chunks and can only send the whole file as multipart encoded. So for Html4, you may need to change settings in Web.config for increasing request limits.

Information on various request limits:

  • ASP.NET Classic by default has 4096 (4 MB) request limit, controlled by system.web/httpRuntime/maxRequestLength property in Web.Config, in kilobytes, maximum value is 2097151 (1,99 GB). This setting effects FileUploader only if you are running under server runtime lower than ASP.NET Classic 4.5 version, i.e when FileUploader cannot automatically override it.
  • ASP.NET Core by default has 30000000 (28.6 MB) request limit, controlled by IHttpMaxRequestBodySizeFeature.MaxRequestBodySize property in code, in bytes, maximum value is unlimited if null. This setting does not effect FileUploader, i.e FileUploader can automatically override it.
  • IIS by default has 30000000 (28.6 MB) request limit, controlled by system.webServer/requestLimits/maxAllowedContentLength property in Web.Config, in bytes, maximum value is 4294967295 (3,99 GB). This setting effects FileUploader, as it is an IIS setting, FileUploader cannot automatically override it.
Public propertyClientEvents
Gets or sets the client-side event handlers.
Public propertyDebugMode
Gets or sets a value indicating whether to display detailed error messages for troubleshooting. Exceptions will be displayed with stack trace, inner exceptions and data.
(Inherited from StatefulComponentControlFileUploader.)
Public propertyDeniedFileTypes
Gets or sets specifies the file patterns that are denied to be uploaded. Denied patterns take precedence over allowed patterns. If not set, no file type is denied (""). When combining patterns in string representation, they should be separated by vertical bar (|).

In a pattern, you can use these wildcards:

  • * matches zero or more characters.
  • ? matches exactly one character.

Some pattern examples:

  • *.* matches files with any extension (does not match files without an extension)
  • *.jpg matches files only with jpg extension
  • picture*.jpg matches files only with jpg extension and which names start with 'picture'
  • picture.* matches files with any extension and which names start with 'picture'
  • picture matches files with no extension and which names are exactly 'picture'
  • *.jp* matches files like 'picture.jpg', 'otherpicture.jpe', 'somepicture.jpeg' etc.
  • *.jp? matches files like 'picture.jpg', 'otherpicture.jpe' etc.
  • picture?.jpg matches files like 'picture1.jpg', 'picture2.jpg', 'pictures.jpg' etc.

Public propertyDisplayLanguage
Gets or sets the display (user interface) language of the file uploader. It is usually set as the two-letter language names like en, de, fr etc. as the bundled languages are usually for general language names. However it can be also set to specific cultures like en-US, de-DE, fr-FR etc. For example, if the property is set to a specific culture like de-CH (German in Switzerland), the component will first look for the language file FileUltimate-de-CH.xml and if the file is not found, it will load the general (fallback) language file of that culture which is FileUltimate-de.xml. If not set, the language file which matches the current UICulture of the host application will be loaded. If there is no language file which matches the current UICulture or its fallback, then the default language file FileUltimate.xml is loaded.
Public propertyDisplayMode
Gets or sets a value indicating whether the control is rendered as InPlace (default), Panel, Window or Viewport.
(Inherited from ComponentControlFileUploader.)
Public propertyFormatLanguage
Gets or sets the format language of the file uploader. Format language is used for the number and date/time formats. It is usually set as the specific cultures like en-US, de-DE, fr-FR etc. If not set, the current Culture of the host application will be used.
Public propertyHeight
Gets or sets the height of the control.
(Inherited from ComponentControlFileUploader.)
Public propertyHidden
Gets or sets a value indicating whether the control is displayed when page is loaded. When set to false, the control can be displayed later on client-side manually. For example, the control can be displayed via a button's click event.
(Inherited from ComponentControlFileUploader.)
Public propertyID
Gets or sets the control id and HTML id of the control. Also a javascript variable with the same name is automatically defined and it can be used to access the client-side implementation of the control. If omitted, Id will be automatically set to the class name of this control (e.g camel-case className without Control suffix) and if there are other instances on the same page, to className2 ... classNameX.
(Inherited from ComponentControlFileUploader.)
Public propertyMaxFileSize
Gets or sets the maximum allowed file size to upload. If not set, there will be no size limit for upload. 0 (zero) also means unlimited.
Public propertyMethods
Gets or sets a comma separated upload methods in priority order. The default is "Html5, Silverlight, Flash, Html4". It's not recommended to change this property as the default order offers the best upload experience.
Public propertyPanelOptions
Gets or sets the panel options used for Panel mode.
(Inherited from ComponentControlFileUploader.)
Public propertyProductInfoRendered
Gets or sets a value indicating whether product info/copyright comment is rendered in html.
(Inherited from ComponentControlFileUploader.)
Public propertyResizable
Gets or sets a value that specifies if the control can be resized when the user drags sides.
(Inherited from ComponentControlFileUploader.)
Public propertyResizeHandles
Gets or sets a value that specifies the handles which can be used for resizing the control. Default is South, East and SouthEast. When using Window mode, set ResizeHandles which overrides this property.
(Inherited from ComponentControlFileUploader.)
Public propertyShowFileExtensions
Gets or sets a value that specifies whether the extension part of the file names should be be displayed. The default is false. When this set to true, the file extension will be also editable in dialog boxes when user is prompted (eg. on Rename).
Public propertyStateId
Gets or sets the state id of the control. This is determined automatically when state is saved to session.
(Inherited from StatefulComponentControlFileUploader.)
Public propertyUploadLocation
Gets or sets the file system location for uploading files to. The default value is "~/App_Data/Uploads". By default, the location is considered on disk but you can use this property to upload to any of the supported file systems like UNC paths with password, Amazon S3 and Azure Blob.
Public propertyUploadProviderType
Gets or sets the upload provider type which provides a custom way of handling uploaded files. If not set, by default DefaultUploadProvider will be used which will handle uploads according to UploadLocation property. This class should implement IUploadProvider interface and should have a parameterless constructor so that it can be instantiated internally when necessary.
Public propertyViewLayout
Gets or sets the initial view layout type for listing files and folders that added to the upload queue. The default is LargeIcons. Possible values are ExtraLargeIcons, LargeIcons, MediumIcons, SmallIcons, Details and Tiles.
Public propertyWidth
Gets or sets the width of the control.
(Inherited from ComponentControlFileUploader.)
Public propertyWindowOptions
Gets or sets the windows options used for Window mode.
(Inherited from ComponentControlFileUploader.)
Top
Events
  NameDescription
Public eventFailed
Occurs when a queue for one or more items fails in file uploader.
Public eventItemFailed
Occurs when an item of a queue fails in file uploader.
Public eventItemUploaded
Occurs after user uploads an item of a queue in file uploader.
Public eventItemUploading
Occurs before user uploads an item of a queue in file uploader.
Public eventUploaded
Occurs after user uploads a queue for one or more items in file uploader.
Public eventUploading
Occurs before user uploads a queue for one or more items in file uploader.
Top
Examples
<%@ Register TagPrefix="GleamTech" Namespace="GleamTech.FileUltimate.AspNet.UI" Assembly="GleamTech.FileUltimate" %>
<%@ Register TagPrefix="GleamTech" Namespace="GleamTech.FileUltimate.AspNet.WebForms" Assembly="GleamTech.FileUltimate" %>

<!DOCTYPE html>
<html>
    <head runat="server">
        <title>File Uploader</title>
    </head>
    <body>

        <GleamTech:FileUploaderControl ID="fileUploader" runat="server" 
                                       Width="600"
                                       Height="300" 
                                       Resizable="True" 
                                       UploadLocation = "~/App_Data/Uploads" />

    </body>
</html>
See Also