class sap.ui.unified.FileUploader

Visiblity: public
UX Guidelines: Upload Collection
Implements: sap.ui.core.IFormContentsap.ui.unified.IProcessableBlobs
Available since: N/A
Module: sap/ui/unified/FileUploader
Application Component: CA-UI5-CTR

The framework generates an input field and a button with text "Browse ...". The API supports features such as on change uploads (the upload starts immediately after a file has been selected), file uploads with explicit calls, adjustable control sizes, text display after uploads, or tooltips containing complete file paths.


Constructor

Constructor for a new FileUploader.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.ui.unified.FileUploader(sId?, mSettings?)
Param Type Default Value Description
sId? string

ID for the new control, generated automatically if no ID is given

mSettings? object

Initial settings for the new control


Properties

Name Type Default Value Description
additionalData string

Additional data that is sent to the back end service.

Data will be transmitted as value of a hidden input where the name is derived from the name property with suffix "-data".

Visibility: public
buttonOnly boolean false

If set to "true", the FileUploader will be rendered as Button only, without showing the input field.

Visibility: public
buttonText string

The button's text can be overwritten using this property.

Visibility: public
enabled boolean true

Disabled controls have different colors, depending on customer settings.

Visibility: public
fileType string[]

The chosen files will be checked against an array of file types.

If at least one file does not fit the file type restriction, the upload is prevented. Note: This property is not supported by Microsoft Edge.

Example: ["jpg", "png", "bmp"].

Visibility: public
httpRequestMethod sap.ui.unified.FileUploaderHttpRequestMethod Post

Chosen HTTP request method for file upload.

Since: 1.81.0.

Visibility: public
icon sap.ui.core.URI empty string

Icon to be displayed as graphical element within the button.

This can be a URI to an image or an icon font URI.

Since: 1.26.0.

Visibility: public
iconFirst boolean true

If set to true (default), the display sequence is 1. icon 2. control text.

Since: 1.26.0.

Visibility: public
iconHovered sap.ui.core.URI empty string

Icon to be displayed as graphical element within the button when it is hovered (only if also a base icon was specified).

If not specified, the base icon is used. If an icon font icon is used, this property is ignored.

Since: 1.26.0.

Visibility: public
iconOnly boolean false

If set to true, the button is displayed without any text.

Since: 1.26.0.

Visibility: public
iconSelected sap.ui.core.URI empty string

Icon to be displayed as graphical element within the button when it is selected (only if also a base icon was specified).

If not specified, the base or hovered icon is used. If an icon font icon is used, this property is ignored.

Since: 1.26.0.

Visibility: public
maximumFileSize float

A file size limit in megabytes which prevents the upload if at least one file exceeds it.

This property is not supported by Internet Explorer 9.

Visibility: public
maximumFilenameLength int

The maximum length of a filename which the FileUploader will accept.

If the maximum filename length is exceeded, the corresponding event filenameLengthExceed is fired.

Since: 1.24.0.

Visibility: public
mimeType string[]

The chosen files will be checked against an array of MIME types defined in this property.

If at least one file does not fit the MIME type restriction, the upload is prevented.

Note: This property is not supported by Internet Explorer. It is only reliable for common file types like images, audio, video, plain text and HTML documents. File types that are not recognized by the browser result in file.type to be returned as an empty string. In this case the verification could not be performed. The file upload is not prevented and the validation based on file type is left to the receiving backend side.

Example: ["image/png", "image/jpeg"].

Visibility: public
multiple boolean false

Allows multiple files to be chosen and uploaded from the same folder.

This property is not supported by Internet Explorer 9.

Note: Keep in mind that the various operating systems for mobile devices can react differently to the property so that fewer upload functions may be available in some cases.

Visibility: public
name string

Unique control name for identification on the server side after sending data to the server.

Visibility: public
placeholder string

Placeholder for the text field.

Visibility: public
sameFilenameAllowed boolean false

If the FileUploader is configured to upload the file directly after the file is selected, it is not allowed to upload a file with the same name again. If a user should be allowed to upload a file with the same name again this parameter has to be "true".

A typical use case would be if the files have different paths.

Visibility: public
sendXHR boolean false

If set to "true", the request will be sent as XHR request instead of a form submit.

This property is not supported by Internet Explorer 9.

Visibility: public
style string

Style of the button.

Values "Transparent, "Accept", "Reject", or "Emphasized" are allowed.

Visibility: public
uploadOnChange boolean false

If set to "true", the upload immediately starts after file selection. With the default setting, the upload needs to be explicitly triggered.

Visibility: public
uploadUrl sap.ui.core.URI empty string

Used when URL address is on a remote server.

Visibility: public
useMultipart boolean true

If set to "false", the request will be sent as file only request instead of a multipart/form-data request.

Only one file could be uploaded using this type of request. Required for sending such a request is to set the property sendXHR to "true". This property is not supported by Internet Explorer 9.

Visibility: public
value string empty string

Value of the path for file upload.

Visibility: public
valueState sap.ui.core.ValueState None

Visualizes warnings or errors related to the text field.

Possible values: Warning, Error, Success, None.

Since: 1.24.0.

Visibility: public
valueStateText string

Custom text for the value state message pop-up.

Note: If not specified, a default text, based on the value state type, will be used instead.

Since: 1.52.

Visibility: public
width sap.ui.core.CSSSize empty string

Specifies the displayed control width.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
headerParameters 0..n sap.ui.unified.FileUploaderParameter

The header parameters for the FileUploader which are only submitted with XHR requests. Header parameters are not supported by Internet Explorer 9.

parameters 0..n sap.ui.unified.FileUploaderParameter

The parameters for the FileUploader which are rendered as a hidden input field.

Since: 1.12.2.

xhrSettings 0..1 sap.ui.unified.FileUploaderXHRSettings

Settings for the XMLHttpRequest object. Note: This aggregation is only used when the sendXHR property is set to true.

Since: 1.52.


Associations

Name Cardinality Type Description
ariaDescribedBy 0..n sap.ui.core.Control

Association to controls / IDs which describe this control (see WAI-ARIA attribute aria-describedby).

ariaLabelledBy 0..n sap.ui.core.Control

Association to controls / IDs which label this control (see WAI-ARIA attribute aria-labelledby).


Events Overview

Event Description
change

Event is fired when the value of the file path has been changed.

Note: Keep in mind that because of the HTML input element of type file, the event is also fired in Chrome browser when the Cancel button of the uploads window is pressed.

fileAllowed

Event is fired when the file is allowed for upload on client side.

fileEmpty

Event is fired when the size of the file is 0

filenameLengthExceed

Event is fired, if the filename of a chosen file is longer than the value specified with the maximumFilenameLength property.

Since: 1.24.0.

fileSizeExceed

Event is fired when the size of a file is above the maximumFileSize property. This event is not supported by Internet Explorer 9 (same restriction as for the property maximumFileSize).

typeMissmatch

Event is fired when the type of a file does not match the mimeType or fileType property.

uploadAborted

Event is fired after the current upload has been aborted.

This event is only supported with property sendXHR set to true, i.e. the event is not supported in Internet Explorer 9.

Since: 1.24.0.

uploadComplete

Event is fired as soon as the upload request is completed (either successful or unsuccessful).

To see if the upload request was successful, check the status parameter for a value 2xx. The actual progress of the upload can be monitored by listening to the uploadProgress event. However, this covers only the client side of the upload process and does not give any success status from the server.

uploadProgress

Event is fired after the upload has started and before the upload is completed.

It contains progress information related to the running upload. Depending on file size, band width and used browser the event is fired once or multiple times.

This event is only supported with property sendXHR set to true, i.e. the event is not supported in Internet Explorer 9.

Since: 1.24.0.

uploadStart

Event is fired before an upload is started.

Since: 1.30.0.

change

Event is fired when the value of the file path has been changed.

Note: Keep in mind that because of the HTML input element of type file, the event is also fired in Chrome browser when the Cancel button of the uploads window is pressed.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
newValue string

New file path value.

files object[]

Files.

fileAllowed

Event is fired when the file is allowed for upload on client side.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

fileEmpty

Event is fired when the size of the file is 0

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
fileName string

The name of the file to be uploaded.

filenameLengthExceed

Event is fired, if the filename of a chosen file is longer than the value specified with the maximumFilenameLength property.

Since: 1.24.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
fileName string

The filename, which is longer than specified by the value of the property maximumFilenameLength.

fileSizeExceed

Event is fired when the size of a file is above the maximumFileSize property. This event is not supported by Internet Explorer 9 (same restriction as for the property maximumFileSize).

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
fileName string

The name of a file to be uploaded.

fileSize string

The size in MB of a file to be uploaded.

typeMissmatch

Event is fired when the type of a file does not match the mimeType or fileType property.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
fileName string

The name of a file to be uploaded.

fileType string

The file ending of a file to be uploaded.

mimeType string

The MIME type of a file to be uploaded.

uploadAborted

Event is fired after the current upload has been aborted.

This event is only supported with property sendXHR set to true, i.e. the event is not supported in Internet Explorer 9.

Since: 1.24.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
fileName string

The name of a file to be uploaded.

requestHeaders object[]

Http-Request-Headers.

Required for receiving requestHeader is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

uploadComplete

Event is fired as soon as the upload request is completed (either successful or unsuccessful).

To see if the upload request was successful, check the status parameter for a value 2xx. The actual progress of the upload can be monitored by listening to the uploadProgress event. However, this covers only the client side of the upload process and does not give any success status from the server.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
fileName string

The name of a file to be uploaded.

response string

Response message which comes from the server.

On the server side this response has to be put within the "body" tags of the response document of the iFrame. It can consist of a return code and an optional message. This does not work in cross-domain scenarios.

readyStateXHR string

ReadyState of the XHR request.

Required for receiving a readyStateXHR is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

status string

Status of the XHR request.

Required for receiving a status is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

responseRaw string

Http-Response which comes from the server.

Required for receiving responseRaw is to set the property sendXHR to true.

This property is not supported by Internet Explorer 9.

headers object

Http-Response-Headers which come from the server.

Provided as a JSON-map, i.e. each header-field is reflected by a property in the headers object, with the property value reflecting the header-field's content.

Required for receiving headers is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

requestHeaders object[]

Http-Request-Headers.

Required for receiving requestHeaders is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

uploadProgress

Event is fired after the upload has started and before the upload is completed.

It contains progress information related to the running upload. Depending on file size, band width and used browser the event is fired once or multiple times.

This event is only supported with property sendXHR set to true, i.e. the event is not supported in Internet Explorer 9.

Since: 1.24.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
lengthComputable boolean

Indicates whether or not the relative upload progress can be calculated out of loaded and total.

loaded float

The number of bytes of the file which have been uploaded by the time the event was fired.

total float

The total size of the file to be uploaded in bytes.

fileName string

The name of a file to be uploaded.

requestHeaders object[]

Http-Request-Headers.

Required for receiving requestHeaders is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

uploadStart

Event is fired before an upload is started.

Since: 1.30.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
fileName string

The name of a file to be uploaded.

requestHeaders object[]

Http-Request-Headers.

Required for receiving requestHeaders is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.


Methods Overview

Method Description
abort

Aborts the currently running upload.

addAriaDescribedBy

Adds some ariaDescribedBy into the association ariaDescribedBy.

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

addHeaderParameter

Adds some headerParameter to the aggregation headerParameters.

addParameter

Adds some parameter to the aggregation parameters.

attachChange

Attaches event handler fnFunction to the change event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired when the value of the file path has been changed.

Note: Keep in mind that because of the HTML input element of type file, the event is also fired in Chrome browser when the Cancel button of the uploads window is pressed.

attachFileAllowed

Attaches event handler fnFunction to the fileAllowed event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired when the file is allowed for upload on client side.

attachFileEmpty

Attaches event handler fnFunction to the fileEmpty event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired when the size of the file is 0

attachFilenameLengthExceed

Attaches event handler fnFunction to the filenameLengthExceed event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired, if the filename of a chosen file is longer than the value specified with the maximumFilenameLength property.

attachFileSizeExceed

Attaches event handler fnFunction to the fileSizeExceed event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired when the size of a file is above the maximumFileSize property. This event is not supported by Internet Explorer 9 (same restriction as for the property maximumFileSize).

attachTypeMissmatch

Attaches event handler fnFunction to the typeMissmatch event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired when the type of a file does not match the mimeType or fileType property.

attachUploadAborted

Attaches event handler fnFunction to the uploadAborted event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired after the current upload has been aborted.

This event is only supported with property sendXHR set to true, i.e. the event is not supported in Internet Explorer 9.

attachUploadComplete

Attaches event handler fnFunction to the uploadComplete event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired as soon as the upload request is completed (either successful or unsuccessful).

To see if the upload request was successful, check the status parameter for a value 2xx. The actual progress of the upload can be monitored by listening to the uploadProgress event. However, this covers only the client side of the upload process and does not give any success status from the server.

attachUploadProgress

Attaches event handler fnFunction to the uploadProgress event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired after the upload has started and before the upload is completed.

It contains progress information related to the running upload. Depending on file size, band width and used browser the event is fired once or multiple times.

This event is only supported with property sendXHR set to true, i.e. the event is not supported in Internet Explorer 9.

attachUploadStart

Attaches event handler fnFunction to the uploadStart event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired before an upload is started.

checkFileReadable

Checks if the chosen file is readable.

clear

Clears the content of the FileUploader.

Note: The attached additional data however is retained.

destroyHeaderParameters

Destroys all the headerParameters in the aggregation headerParameters.

destroyParameters

Destroys all the parameters in the aggregation parameters.

destroyXhrSettings

Destroys the xhrSettings in the aggregation xhrSettings.

detachChange

Detaches event handler fnFunction from the change event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

detachFileAllowed

Detaches event handler fnFunction from the fileAllowed event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

detachFileEmpty

Detaches event handler fnFunction from the fileEmpty event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

detachFilenameLengthExceed

Detaches event handler fnFunction from the filenameLengthExceed event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

detachFileSizeExceed

Detaches event handler fnFunction from the fileSizeExceed event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

detachTypeMissmatch

Detaches event handler fnFunction from the typeMissmatch event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

detachUploadAborted

Detaches event handler fnFunction from the uploadAborted event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

detachUploadComplete

Detaches event handler fnFunction from the uploadComplete event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

detachUploadProgress

Detaches event handler fnFunction from the uploadProgress event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

detachUploadStart

Detaches event handler fnFunction from the uploadStart event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

sap.ui.unified.FileUploader.extend

Creates a new subclass of class sap.ui.unified.FileUploader with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

fireChange

Fires event change to attached listeners.

fireFileAllowed

Fires event fileAllowed to attached listeners.

fireFileEmpty

Fires event fileEmpty to attached listeners.

fireFilenameLengthExceed

Fires event filenameLengthExceed to attached listeners.

fireFileSizeExceed

Fires event fileSizeExceed to attached listeners.

fireTypeMissmatch

Fires event typeMissmatch to attached listeners.

fireUploadAborted

Fires event uploadAborted to attached listeners.

fireUploadComplete

Fires event uploadComplete to attached listeners.

fireUploadProgress

Fires event uploadProgress to attached listeners.

fireUploadStart

Fires event uploadStart to attached listeners.

getAdditionalData

Gets current value of property additionalData.

Additional data that is sent to the back end service.

Data will be transmitted as value of a hidden input where the name is derived from the name property with suffix "-data".

getAriaDescribedBy

Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getButtonOnly

Gets current value of property buttonOnly.

If set to "true", the FileUploader will be rendered as Button only, without showing the input field.

Default value is false.

getButtonText

Gets current value of property buttonText.

The button's text can be overwritten using this property.

getEnabled

Gets current value of property enabled.

Disabled controls have different colors, depending on customer settings.

Default value is true.

getFileType

Gets current value of property fileType.

The chosen files will be checked against an array of file types.

If at least one file does not fit the file type restriction, the upload is prevented. Note: This property is not supported by Microsoft Edge.

Example: ["jpg", "png", "bmp"].

getHeaderParameters

Gets content of aggregation headerParameters.

The header parameters for the FileUploader which are only submitted with XHR requests. Header parameters are not supported by Internet Explorer 9.

getHttpRequestMethod

Gets current value of property httpRequestMethod.

Chosen HTTP request method for file upload.

Default value is Post.

getIcon

Gets current value of property icon.

Icon to be displayed as graphical element within the button.

This can be a URI to an image or an icon font URI.

Default value is empty string.

getIconFirst

Gets current value of property iconFirst.

If set to true (default), the display sequence is 1. icon 2. control text.

Default value is true.

getIconHovered

Gets current value of property iconHovered.

Icon to be displayed as graphical element within the button when it is hovered (only if also a base icon was specified).

If not specified, the base icon is used. If an icon font icon is used, this property is ignored.

Default value is empty string.

getIconOnly

Gets current value of property iconOnly.

If set to true, the button is displayed without any text.

Default value is false.

getIconSelected

Gets current value of property iconSelected.

Icon to be displayed as graphical element within the button when it is selected (only if also a base icon was specified).

If not specified, the base or hovered icon is used. If an icon font icon is used, this property is ignored.

Default value is empty string.

getMaximumFilenameLength

Gets current value of property maximumFilenameLength.

The maximum length of a filename which the FileUploader will accept.

If the maximum filename length is exceeded, the corresponding event filenameLengthExceed is fired.

getMaximumFileSize

Gets current value of property maximumFileSize.

A file size limit in megabytes which prevents the upload if at least one file exceeds it.

This property is not supported by Internet Explorer 9.

sap.ui.unified.FileUploader.getMetadata

Returns a metadata object for class sap.ui.unified.FileUploader.

getMimeType

Gets current value of property mimeType.

The chosen files will be checked against an array of MIME types defined in this property.

If at least one file does not fit the MIME type restriction, the upload is prevented.

Note: This property is not supported by Internet Explorer. It is only reliable for common file types like images, audio, video, plain text and HTML documents. File types that are not recognized by the browser result in file.type to be returned as an empty string. In this case the verification could not be performed. The file upload is not prevented and the validation based on file type is left to the receiving backend side.

Example: ["image/png", "image/jpeg"].

getMultiple

Gets current value of property multiple.

Allows multiple files to be chosen and uploaded from the same folder.

This property is not supported by Internet Explorer 9.

Note: Keep in mind that the various operating systems for mobile devices can react differently to the property so that fewer upload functions may be available in some cases.

Default value is false.

getName

Gets current value of property name.

Unique control name for identification on the server side after sending data to the server.

getParameters

Gets content of aggregation parameters.

The parameters for the FileUploader which are rendered as a hidden input field.

getPlaceholder

Gets current value of property placeholder.

Placeholder for the text field.

getProcessedBlobsFromArray

Allows to process Blobs before they get uploaded. This API can be used to create custom Blobs and upload these custom Blobs instead of the received/initials Blobs in the parameter aBlobs. One use case could be to create and upload zip archives based on the passed Blobs. The default implementation of this API should simply resolve with the received Blobs (parameter aBlobs).

This API is only supported in case sendXHR is true. This means only IE10+ is supported, while IE9 and below is not.

This is a default implementation of the interface sap.ui.unified.IProcessableBlobs.

getSameFilenameAllowed

Gets current value of property sameFilenameAllowed.

If the FileUploader is configured to upload the file directly after the file is selected, it is not allowed to upload a file with the same name again. If a user should be allowed to upload a file with the same name again this parameter has to be "true".

A typical use case would be if the files have different paths.

Default value is false.

getSendXHR

Gets current value of property sendXHR.

If set to "true", the request will be sent as XHR request instead of a form submit.

This property is not supported by Internet Explorer 9.

Default value is false.

getStyle

Gets current value of property style.

Style of the button.

Values "Transparent, "Accept", "Reject", or "Emphasized" are allowed.

getUploadOnChange

Gets current value of property uploadOnChange.

If set to "true", the upload immediately starts after file selection. With the default setting, the upload needs to be explicitly triggered.

Default value is false.

getUploadUrl

Gets current value of property uploadUrl.

Used when URL address is on a remote server.

Default value is empty string.

getUseMultipart

Gets current value of property useMultipart.

If set to "false", the request will be sent as file only request instead of a multipart/form-data request.

Only one file could be uploaded using this type of request. Required for sending such a request is to set the property sendXHR to "true". This property is not supported by Internet Explorer 9.

Default value is true.

getValue

Gets current value of property value.

Value of the path for file upload.

Default value is empty string.

getValueState

Gets current value of property valueState.

Visualizes warnings or errors related to the text field.

Possible values: Warning, Error, Success, None.

Default value is None.

getValueStateText

Gets current value of property valueStateText.

Custom text for the value state message pop-up.

Note: If not specified, a default text, based on the value state type, will be used instead.

getWidth

Gets current value of property width.

Specifies the displayed control width.

Default value is empty string.

getXhrSettings

Gets content of aggregation xhrSettings.

Settings for the XMLHttpRequest object. Note: This aggregation is only used when the sendXHR property is set to true.

indexOfHeaderParameter

Checks for the provided sap.ui.unified.FileUploaderParameter in the aggregation headerParameters. and returns its index if found or -1 otherwise.

indexOfParameter

Checks for the provided sap.ui.unified.FileUploaderParameter in the aggregation parameters. and returns its index if found or -1 otherwise.

insertHeaderParameter

Inserts a headerParameter into the aggregation headerParameters.

insertParameter

Inserts a parameter into the aggregation parameters.

removeAllAriaDescribedBy

Removes all the controls in the association named ariaDescribedBy.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAllHeaderParameters

Removes all the controls from the aggregation headerParameters.

Additionally, it unregisters them from the hosting UIArea.

removeAllParameters

Removes all the controls from the aggregation parameters.

Additionally, it unregisters them from the hosting UIArea.

removeAriaDescribedBy

Removes an ariaDescribedBy from the association named ariaDescribedBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

removeHeaderParameter

Removes a headerParameter from the aggregation headerParameters.

removeParameter

Removes a parameter from the aggregation parameters.

setAdditionalData

Sets a new value for property additionalData.

Additional data that is sent to the back end service.

Data will be transmitted as value of a hidden input where the name is derived from the name property with suffix "-data".

When called with a value of null or undefined, the default value of the property will be restored.

setButtonOnly

Sets a new value for property buttonOnly.

If set to "true", the FileUploader will be rendered as Button only, without showing the input field.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setButtonText

Sets a new value for property buttonText.

The button's text can be overwritten using this property.

When called with a value of null or undefined, the default value of the property will be restored.

setEnabled

Sets a new value for property enabled.

Disabled controls have different colors, depending on customer settings.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setFileType

Sets a new value for property fileType.

The chosen files will be checked against an array of file types.

If at least one file does not fit the file type restriction, the upload is prevented. Note: This property is not supported by Microsoft Edge.

Example: ["jpg", "png", "bmp"].

When called with a value of null or undefined, the default value of the property will be restored.

setHttpRequestMethod

Sets a new value for property httpRequestMethod.

Chosen HTTP request method for file upload.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Post.

setIcon

Sets a new value for property icon.

Icon to be displayed as graphical element within the button.

This can be a URI to an image or an icon font URI.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

setIconFirst

Sets a new value for property iconFirst.

If set to true (default), the display sequence is 1. icon 2. control text.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setIconHovered

Sets a new value for property iconHovered.

Icon to be displayed as graphical element within the button when it is hovered (only if also a base icon was specified).

If not specified, the base icon is used. If an icon font icon is used, this property is ignored.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

setIconOnly

Sets a new value for property iconOnly.

If set to true, the button is displayed without any text.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setIconSelected

Sets a new value for property iconSelected.

Icon to be displayed as graphical element within the button when it is selected (only if also a base icon was specified).

If not specified, the base or hovered icon is used. If an icon font icon is used, this property is ignored.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

setMaximumFilenameLength

Sets a new value for property maximumFilenameLength.

The maximum length of a filename which the FileUploader will accept.

If the maximum filename length is exceeded, the corresponding event filenameLengthExceed is fired.

When called with a value of null or undefined, the default value of the property will be restored.

setMaximumFileSize

Sets a new value for property maximumFileSize.

A file size limit in megabytes which prevents the upload if at least one file exceeds it.

This property is not supported by Internet Explorer 9.

When called with a value of null or undefined, the default value of the property will be restored.

setMimeType

Sets a new value for property mimeType.

The chosen files will be checked against an array of MIME types defined in this property.

If at least one file does not fit the MIME type restriction, the upload is prevented.

Note: This property is not supported by Internet Explorer. It is only reliable for common file types like images, audio, video, plain text and HTML documents. File types that are not recognized by the browser result in file.type to be returned as an empty string. In this case the verification could not be performed. The file upload is not prevented and the validation based on file type is left to the receiving backend side.

Example: ["image/png", "image/jpeg"].

When called with a value of null or undefined, the default value of the property will be restored.

setMultiple

Sets a new value for property multiple.

Allows multiple files to be chosen and uploaded from the same folder.

This property is not supported by Internet Explorer 9.

Note: Keep in mind that the various operating systems for mobile devices can react differently to the property so that fewer upload functions may be available in some cases.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setName

Sets a new value for property name.

Unique control name for identification on the server side after sending data to the server.

When called with a value of null or undefined, the default value of the property will be restored.

setPlaceholder

Sets a new value for property placeholder.

Placeholder for the text field.

When called with a value of null or undefined, the default value of the property will be restored.

setSameFilenameAllowed

Sets a new value for property sameFilenameAllowed.

If the FileUploader is configured to upload the file directly after the file is selected, it is not allowed to upload a file with the same name again. If a user should be allowed to upload a file with the same name again this parameter has to be "true".

A typical use case would be if the files have different paths.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setSendXHR

Sets a new value for property sendXHR.

If set to "true", the request will be sent as XHR request instead of a form submit.

This property is not supported by Internet Explorer 9.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setStyle

Sets a new value for property style.

Style of the button.

Values "Transparent, "Accept", "Reject", or "Emphasized" are allowed.

When called with a value of null or undefined, the default value of the property will be restored.

setUploadOnChange

Sets a new value for property uploadOnChange.

If set to "true", the upload immediately starts after file selection. With the default setting, the upload needs to be explicitly triggered.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setUploadUrl

Sets a new value for property uploadUrl.

Used when URL address is on a remote server.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

setUseMultipart

Sets a new value for property useMultipart.

If set to "false", the request will be sent as file only request instead of a multipart/form-data request.

Only one file could be uploaded using this type of request. Required for sending such a request is to set the property sendXHR to "true". This property is not supported by Internet Explorer 9.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setValue

Sets a new value for property value.

Value of the path for file upload.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

setValueState

Sets a new value for property valueState.

Visualizes warnings or errors related to the text field.

Possible values: Warning, Error, Success, None.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is None.

setValueStateText

Sets a new value for property valueStateText.

Custom text for the value state message pop-up.

Note: If not specified, a default text, based on the value state type, will be used instead.

When called with a value of null or undefined, the default value of the property will be restored.

setWidth

Sets a new value for property width.

Specifies the displayed control width.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

setXhrSettings

Sets the aggregated xhrSettings.

upload

Starts the upload (as defined by uploadUrl).

abort

Aborts the currently running upload.

Param Type DefaultValue Description
sHeaderParameterName string

The name of the parameter within the headerParameters aggregation to be checked.

Note: aborts the request, sent with a header parameter with the provided name. The parameter is taken into account if the sHeaderParameterValue parameter is provided too.

sHeaderParameterValue string

The value of the parameter within the headerParameters aggregation to be checked.

Note: aborts the request, sent with a header parameter with the provided value. The parameter is taken into account if the sHeaderParameterName parameter is provided too.

addAriaDescribedBy

Adds some ariaDescribedBy into the association ariaDescribedBy.

Param Type DefaultValue Description
vAriaDescribedBy sap.ui.core.ID sap.ui.core.Control

The ariaDescribedBy to add; if empty, nothing is inserted

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to add; if empty, nothing is inserted

addHeaderParameter

Adds some headerParameter to the aggregation headerParameters.

Param Type DefaultValue Description
oHeaderParameter sap.ui.unified.FileUploaderParameter

The headerParameter to add; if empty, nothing is inserted

addParameter

Adds some parameter to the aggregation parameters.

Param Type DefaultValue Description
oParameter sap.ui.unified.FileUploaderParameter

The parameter to add; if empty, nothing is inserted

attachChange

Attaches event handler fnFunction to the change event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired when the value of the file path has been changed.

Note: Keep in mind that because of the HTML input element of type file, the event is also fired in Chrome browser when the Cancel button of the uploads window is pressed.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.FileUploader itself

attachFileAllowed

Attaches event handler fnFunction to the fileAllowed event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired when the file is allowed for upload on client side.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.FileUploader itself

attachFileEmpty

Attaches event handler fnFunction to the fileEmpty event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired when the size of the file is 0

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.FileUploader itself

attachFilenameLengthExceed

Attaches event handler fnFunction to the filenameLengthExceed event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired, if the filename of a chosen file is longer than the value specified with the maximumFilenameLength property.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.FileUploader itself

attachFileSizeExceed

Attaches event handler fnFunction to the fileSizeExceed event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired when the size of a file is above the maximumFileSize property. This event is not supported by Internet Explorer 9 (same restriction as for the property maximumFileSize).

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.FileUploader itself

attachTypeMissmatch

Attaches event handler fnFunction to the typeMissmatch event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired when the type of a file does not match the mimeType or fileType property.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.FileUploader itself

attachUploadAborted

Attaches event handler fnFunction to the uploadAborted event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired after the current upload has been aborted.

This event is only supported with property sendXHR set to true, i.e. the event is not supported in Internet Explorer 9.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.FileUploader itself

attachUploadComplete

Attaches event handler fnFunction to the uploadComplete event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired as soon as the upload request is completed (either successful or unsuccessful).

To see if the upload request was successful, check the status parameter for a value 2xx. The actual progress of the upload can be monitored by listening to the uploadProgress event. However, this covers only the client side of the upload process and does not give any success status from the server.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.FileUploader itself

attachUploadProgress

Attaches event handler fnFunction to the uploadProgress event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired after the upload has started and before the upload is completed.

It contains progress information related to the running upload. Depending on file size, band width and used browser the event is fired once or multiple times.

This event is only supported with property sendXHR set to true, i.e. the event is not supported in Internet Explorer 9.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.FileUploader itself

attachUploadStart

Attaches event handler fnFunction to the uploadStart event of this sap.ui.unified.FileUploader.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.FileUploader itself.

Event is fired before an upload is started.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.FileUploader itself

checkFileReadable

Checks if the chosen file is readable.

clear

Clears the content of the FileUploader.

Note: The attached additional data however is retained.

destroyHeaderParameters

Destroys all the headerParameters in the aggregation headerParameters.

destroyParameters

Destroys all the parameters in the aggregation parameters.

destroyXhrSettings

Destroys the xhrSettings in the aggregation xhrSettings.

detachChange

Detaches event handler fnFunction from the change event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachFileAllowed

Detaches event handler fnFunction from the fileAllowed event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachFileEmpty

Detaches event handler fnFunction from the fileEmpty event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachFilenameLengthExceed

Detaches event handler fnFunction from the filenameLengthExceed event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachFileSizeExceed

Detaches event handler fnFunction from the fileSizeExceed event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachTypeMissmatch

Detaches event handler fnFunction from the typeMissmatch event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachUploadAborted

Detaches event handler fnFunction from the uploadAborted event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachUploadComplete

Detaches event handler fnFunction from the uploadComplete event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachUploadProgress

Detaches event handler fnFunction from the uploadProgress event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachUploadStart

Detaches event handler fnFunction from the uploadStart event of this sap.ui.unified.FileUploader.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.ui.unified.FileUploader.extend

Creates a new subclass of class sap.ui.unified.FileUploader with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

fireChange

Fires event change to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

newValue string

New file path value.

files object[]

Files.

fireFileAllowed

Fires event fileAllowed to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireFileEmpty

Fires event fileEmpty to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fileName string

The name of the file to be uploaded.

fireFilenameLengthExceed

Fires event filenameLengthExceed to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fileName string

The filename, which is longer than specified by the value of the property maximumFilenameLength.

fireFileSizeExceed

Fires event fileSizeExceed to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fileName string

The name of a file to be uploaded.

fileSize string

The size in MB of a file to be uploaded.

fireTypeMissmatch

Fires event typeMissmatch to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fileName string

The name of a file to be uploaded.

fileType string

The file ending of a file to be uploaded.

mimeType string

The MIME type of a file to be uploaded.

fireUploadAborted

Fires event uploadAborted to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fileName string

The name of a file to be uploaded.

requestHeaders object[]

Http-Request-Headers.

Required for receiving requestHeader is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

fireUploadComplete

Fires event uploadComplete to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fileName string

The name of a file to be uploaded.

response string

Response message which comes from the server.

On the server side this response has to be put within the "body" tags of the response document of the iFrame. It can consist of a return code and an optional message. This does not work in cross-domain scenarios.

readyStateXHR string

ReadyState of the XHR request.

Required for receiving a readyStateXHR is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

status string

Status of the XHR request.

Required for receiving a status is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

responseRaw string

Http-Response which comes from the server.

Required for receiving responseRaw is to set the property sendXHR to true.

This property is not supported by Internet Explorer 9.

headers object

Http-Response-Headers which come from the server.

Provided as a JSON-map, i.e. each header-field is reflected by a property in the headers object, with the property value reflecting the header-field's content.

Required for receiving headers is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

requestHeaders object[]

Http-Request-Headers.

Required for receiving requestHeaders is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

fireUploadProgress

Fires event uploadProgress to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

lengthComputable boolean

Indicates whether or not the relative upload progress can be calculated out of loaded and total.

loaded float

The number of bytes of the file which have been uploaded by the time the event was fired.

total float

The total size of the file to be uploaded in bytes.

fileName string

The name of a file to be uploaded.

requestHeaders object[]

Http-Request-Headers.

Required for receiving requestHeaders is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

fireUploadStart

Fires event uploadStart to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fileName string

The name of a file to be uploaded.

requestHeaders object[]

Http-Request-Headers.

Required for receiving requestHeaders is to set the property sendXHR to true. This property is not supported by Internet Explorer 9.

getAdditionalData

Gets current value of property additionalData.

Additional data that is sent to the back end service.

Data will be transmitted as value of a hidden input where the name is derived from the name property with suffix "-data".

getAriaDescribedBy

Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getButtonOnly

Gets current value of property buttonOnly.

If set to "true", the FileUploader will be rendered as Button only, without showing the input field.

Default value is false.

getButtonText

Gets current value of property buttonText.

The button's text can be overwritten using this property.

getEnabled

Gets current value of property enabled.

Disabled controls have different colors, depending on customer settings.

Default value is true.

getFileType

Gets current value of property fileType.

The chosen files will be checked against an array of file types.

If at least one file does not fit the file type restriction, the upload is prevented. Note: This property is not supported by Microsoft Edge.

Example: ["jpg", "png", "bmp"].

getHeaderParameters

Gets content of aggregation headerParameters.

The header parameters for the FileUploader which are only submitted with XHR requests. Header parameters are not supported by Internet Explorer 9.

getHttpRequestMethod

Gets current value of property httpRequestMethod.

Chosen HTTP request method for file upload.

Default value is Post.

getIcon

Gets current value of property icon.

Icon to be displayed as graphical element within the button.

This can be a URI to an image or an icon font URI.

Default value is empty string.

getIconFirst

Gets current value of property iconFirst.

If set to true (default), the display sequence is 1. icon 2. control text.

Default value is true.

getIconHovered

Gets current value of property iconHovered.

Icon to be displayed as graphical element within the button when it is hovered (only if also a base icon was specified).

If not specified, the base icon is used. If an icon font icon is used, this property is ignored.

Default value is empty string.

getIconOnly

Gets current value of property iconOnly.

If set to true, the button is displayed without any text.

Default value is false.

getIconSelected

Gets current value of property iconSelected.

Icon to be displayed as graphical element within the button when it is selected (only if also a base icon was specified).

If not specified, the base or hovered icon is used. If an icon font icon is used, this property is ignored.

Default value is empty string.

getMaximumFilenameLength

Gets current value of property maximumFilenameLength.

The maximum length of a filename which the FileUploader will accept.

If the maximum filename length is exceeded, the corresponding event filenameLengthExceed is fired.

getMaximumFileSize

Gets current value of property maximumFileSize.

A file size limit in megabytes which prevents the upload if at least one file exceeds it.

This property is not supported by Internet Explorer 9.

sap.ui.unified.FileUploader.getMetadata

Returns a metadata object for class sap.ui.unified.FileUploader.

getMimeType

Gets current value of property mimeType.

The chosen files will be checked against an array of MIME types defined in this property.

If at least one file does not fit the MIME type restriction, the upload is prevented.

Note: This property is not supported by Internet Explorer. It is only reliable for common file types like images, audio, video, plain text and HTML documents. File types that are not recognized by the browser result in file.type to be returned as an empty string. In this case the verification could not be performed. The file upload is not prevented and the validation based on file type is left to the receiving backend side.

Example: ["image/png", "image/jpeg"].

getMultiple

Gets current value of property multiple.

Allows multiple files to be chosen and uploaded from the same folder.

This property is not supported by Internet Explorer 9.

Note: Keep in mind that the various operating systems for mobile devices can react differently to the property so that fewer upload functions may be available in some cases.

Default value is false.

getName

Gets current value of property name.

Unique control name for identification on the server side after sending data to the server.

getParameters

Gets content of aggregation parameters.

The parameters for the FileUploader which are rendered as a hidden input field.

getPlaceholder

Gets current value of property placeholder.

Placeholder for the text field.

getProcessedBlobsFromArray

Allows to process Blobs before they get uploaded. This API can be used to create custom Blobs and upload these custom Blobs instead of the received/initials Blobs in the parameter aBlobs. One use case could be to create and upload zip archives based on the passed Blobs. The default implementation of this API should simply resolve with the received Blobs (parameter aBlobs).

This API is only supported in case sendXHR is true. This means only IE10+ is supported, while IE9 and below is not.

This is a default implementation of the interface sap.ui.unified.IProcessableBlobs.

Param Type DefaultValue Description
aBlobs Blob[]

The initial Blobs which can be used to determine/calculate a new array of Blobs for further processing.

getSameFilenameAllowed

Gets current value of property sameFilenameAllowed.

If the FileUploader is configured to upload the file directly after the file is selected, it is not allowed to upload a file with the same name again. If a user should be allowed to upload a file with the same name again this parameter has to be "true".

A typical use case would be if the files have different paths.

Default value is false.

getSendXHR

Gets current value of property sendXHR.

If set to "true", the request will be sent as XHR request instead of a form submit.

This property is not supported by Internet Explorer 9.

Default value is false.

getStyle

Gets current value of property style.

Style of the button.

Values "Transparent, "Accept", "Reject", or "Emphasized" are allowed.

getUploadOnChange

Gets current value of property uploadOnChange.

If set to "true", the upload immediately starts after file selection. With the default setting, the upload needs to be explicitly triggered.

Default value is false.

getUploadUrl

Gets current value of property uploadUrl.

Used when URL address is on a remote server.

Default value is empty string.

getUseMultipart

Gets current value of property useMultipart.

If set to "false", the request will be sent as file only request instead of a multipart/form-data request.

Only one file could be uploaded using this type of request. Required for sending such a request is to set the property sendXHR to "true". This property is not supported by Internet Explorer 9.

Default value is true.

getValue

Gets current value of property value.

Value of the path for file upload.

Default value is empty string.

getValueState

Gets current value of property valueState.

Visualizes warnings or errors related to the text field.

Possible values: Warning, Error, Success, None.

Default value is None.

getValueStateText

Gets current value of property valueStateText.

Custom text for the value state message pop-up.

Note: If not specified, a default text, based on the value state type, will be used instead.

getWidth

Gets current value of property width.

Specifies the displayed control width.

Default value is empty string.

getXhrSettings

Gets content of aggregation xhrSettings.

Settings for the XMLHttpRequest object. Note: This aggregation is only used when the sendXHR property is set to true.

indexOfHeaderParameter

Checks for the provided sap.ui.unified.FileUploaderParameter in the aggregation headerParameters. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oHeaderParameter sap.ui.unified.FileUploaderParameter

The headerParameter whose index is looked for

indexOfParameter

Checks for the provided sap.ui.unified.FileUploaderParameter in the aggregation parameters. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oParameter sap.ui.unified.FileUploaderParameter

The parameter whose index is looked for

insertHeaderParameter

Inserts a headerParameter into the aggregation headerParameters.

Param Type DefaultValue Description
oHeaderParameter sap.ui.unified.FileUploaderParameter

The headerParameter to insert; if empty, nothing is inserted

iIndex int

The 0-based index the headerParameter should be inserted at; for a negative value of iIndex, the headerParameter is inserted at position 0; for a value greater than the current size of the aggregation, the headerParameter is inserted at the last position

insertParameter

Inserts a parameter into the aggregation parameters.

Param Type DefaultValue Description
oParameter sap.ui.unified.FileUploaderParameter

The parameter to insert; if empty, nothing is inserted

iIndex int

The 0-based index the parameter should be inserted at; for a negative value of iIndex, the parameter is inserted at position 0; for a value greater than the current size of the aggregation, the parameter is inserted at the last position

removeAllAriaDescribedBy

Removes all the controls in the association named ariaDescribedBy.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAllHeaderParameters

Removes all the controls from the aggregation headerParameters.

Additionally, it unregisters them from the hosting UIArea.

removeAllParameters

Removes all the controls from the aggregation parameters.

Additionally, it unregisters them from the hosting UIArea.

removeAriaDescribedBy

Removes an ariaDescribedBy from the association named ariaDescribedBy.

Param Type DefaultValue Description
vAriaDescribedBy int sap.ui.core.ID sap.ui.core.Control

The ariaDescribedBy to be removed or its index or ID

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy int sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to be removed or its index or ID

removeHeaderParameter

Removes a headerParameter from the aggregation headerParameters.

Param Type DefaultValue Description
vHeaderParameter int string sap.ui.unified.FileUploaderParameter

The headerParameter to remove or its index or id

removeParameter

Removes a parameter from the aggregation parameters.

Param Type DefaultValue Description
vParameter int string sap.ui.unified.FileUploaderParameter

The parameter to remove or its index or id

setAdditionalData

Sets a new value for property additionalData.

Additional data that is sent to the back end service.

Data will be transmitted as value of a hidden input where the name is derived from the name property with suffix "-data".

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sAdditionalData string

New value for property additionalData

setButtonOnly

Sets a new value for property buttonOnly.

If set to "true", the FileUploader will be rendered as Button only, without showing the input field.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bButtonOnly boolean false

New value for property buttonOnly

setButtonText

Sets a new value for property buttonText.

The button's text can be overwritten using this property.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sButtonText string

New value for property buttonText

setEnabled

Sets a new value for property enabled.

Disabled controls have different colors, depending on customer settings.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bEnabled boolean true

New value for property enabled

setFileType

Sets a new value for property fileType.

The chosen files will be checked against an array of file types.

If at least one file does not fit the file type restriction, the upload is prevented. Note: This property is not supported by Microsoft Edge.

Example: ["jpg", "png", "bmp"].

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sFileType string[]

New value for property fileType

setHttpRequestMethod

Sets a new value for property httpRequestMethod.

Chosen HTTP request method for file upload.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Post.

Param Type DefaultValue Description
sHttpRequestMethod sap.ui.unified.FileUploaderHttpRequestMethod Post

New value for property httpRequestMethod

setIcon

Sets a new value for property icon.

Icon to be displayed as graphical element within the button.

This can be a URI to an image or an icon font URI.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

Param Type DefaultValue Description
sIcon sap.ui.core.URI ''

New value for property icon

setIconFirst

Sets a new value for property iconFirst.

If set to true (default), the display sequence is 1. icon 2. control text.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bIconFirst boolean true

New value for property iconFirst

setIconHovered

Sets a new value for property iconHovered.

Icon to be displayed as graphical element within the button when it is hovered (only if also a base icon was specified).

If not specified, the base icon is used. If an icon font icon is used, this property is ignored.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

Param Type DefaultValue Description
sIconHovered sap.ui.core.URI ''

New value for property iconHovered

setIconOnly

Sets a new value for property iconOnly.

If set to true, the button is displayed without any text.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bIconOnly boolean false

New value for property iconOnly

setIconSelected

Sets a new value for property iconSelected.

Icon to be displayed as graphical element within the button when it is selected (only if also a base icon was specified).

If not specified, the base or hovered icon is used. If an icon font icon is used, this property is ignored.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

Param Type DefaultValue Description
sIconSelected sap.ui.core.URI ''

New value for property iconSelected

setMaximumFilenameLength

Sets a new value for property maximumFilenameLength.

The maximum length of a filename which the FileUploader will accept.

If the maximum filename length is exceeded, the corresponding event filenameLengthExceed is fired.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
iMaximumFilenameLength int

New value for property maximumFilenameLength

setMaximumFileSize

Sets a new value for property maximumFileSize.

A file size limit in megabytes which prevents the upload if at least one file exceeds it.

This property is not supported by Internet Explorer 9.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
fMaximumFileSize float

New value for property maximumFileSize

setMimeType

Sets a new value for property mimeType.

The chosen files will be checked against an array of MIME types defined in this property.

If at least one file does not fit the MIME type restriction, the upload is prevented.

Note: This property is not supported by Internet Explorer. It is only reliable for common file types like images, audio, video, plain text and HTML documents. File types that are not recognized by the browser result in file.type to be returned as an empty string. In this case the verification could not be performed. The file upload is not prevented and the validation based on file type is left to the receiving backend side.

Example: ["image/png", "image/jpeg"].

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sMimeType string[]

New value for property mimeType

setMultiple

Sets a new value for property multiple.

Allows multiple files to be chosen and uploaded from the same folder.

This property is not supported by Internet Explorer 9.

Note: Keep in mind that the various operating systems for mobile devices can react differently to the property so that fewer upload functions may be available in some cases.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bMultiple boolean false

New value for property multiple

setName

Sets a new value for property name.

Unique control name for identification on the server side after sending data to the server.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sName string

New value for property name

setPlaceholder

Sets a new value for property placeholder.

Placeholder for the text field.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sPlaceholder string

New value for property placeholder

setSameFilenameAllowed

Sets a new value for property sameFilenameAllowed.

If the FileUploader is configured to upload the file directly after the file is selected, it is not allowed to upload a file with the same name again. If a user should be allowed to upload a file with the same name again this parameter has to be "true".

A typical use case would be if the files have different paths.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bSameFilenameAllowed boolean false

New value for property sameFilenameAllowed

setSendXHR

Sets a new value for property sendXHR.

If set to "true", the request will be sent as XHR request instead of a form submit.

This property is not supported by Internet Explorer 9.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bSendXHR boolean false

New value for property sendXHR

setStyle

Sets a new value for property style.

Style of the button.

Values "Transparent, "Accept", "Reject", or "Emphasized" are allowed.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sStyle string

New value for property style

setUploadOnChange

Sets a new value for property uploadOnChange.

If set to "true", the upload immediately starts after file selection. With the default setting, the upload needs to be explicitly triggered.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bUploadOnChange boolean false

New value for property uploadOnChange

setUploadUrl

Sets a new value for property uploadUrl.

Used when URL address is on a remote server.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

Param Type DefaultValue Description
sUploadUrl sap.ui.core.URI ''

New value for property uploadUrl

setUseMultipart

Sets a new value for property useMultipart.

If set to "false", the request will be sent as file only request instead of a multipart/form-data request.

Only one file could be uploaded using this type of request. Required for sending such a request is to set the property sendXHR to "true". This property is not supported by Internet Explorer 9.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bUseMultipart boolean true

New value for property useMultipart

setValue

Sets a new value for property value.

Value of the path for file upload.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

Param Type DefaultValue Description
sValue string ''

New value for property value

setValueState

Sets a new value for property valueState.

Visualizes warnings or errors related to the text field.

Possible values: Warning, Error, Success, None.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is None.

Param Type DefaultValue Description
sValueState sap.ui.core.ValueState None

New value for property valueState

setValueStateText

Sets a new value for property valueStateText.

Custom text for the value state message pop-up.

Note: If not specified, a default text, based on the value state type, will be used instead.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sValueStateText string

New value for property valueStateText

setWidth

Sets a new value for property width.

Specifies the displayed control width.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

Param Type DefaultValue Description
sWidth sap.ui.core.CSSSize ''

New value for property width

setXhrSettings

Sets the aggregated xhrSettings.

Param Type DefaultValue Description
oXhrSettings sap.ui.unified.FileUploaderXHRSettings

The xhrSettings to set

upload

Starts the upload (as defined by uploadUrl).

Param Type DefaultValue Description
bPreProcessFiles boolean

Set to true to allow pre-processing of the files before sending the request. As a result, the upload method becomes asynchronous. See sap.ui.unified.IProcessableBlobs for more information. Note: This parameter is only taken into account when sendXHR is set to true.