class sap.m.UploadCollection

Control sample: sap.m.UploadCollection
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/m/UploadCollection
Application Component: CA-UI5-SC

This control allows you to upload single or multiple files from your devices (desktop, tablet or phone) and attach them to the application.

The consuming application needs to take into account that the consistency checks of the model during the upload of the file need to be performed, for example, if the user is editing or deleting a file.
As of version 1.63, there is an sap.m.upload.UploadSet control available that is based on this control. sap.m.upload.UploadSet provides enhanced handling of headers and requests, unified behavior of instant and deferred uploads, as well as improved progress indication.


Constructor

Constructor for a new UploadCollection.

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.m.UploadCollection(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
fileType string[]

Defines the allowed file types for the upload. The chosen files will be checked against an array of file types. If at least one file does not fit the file type requirements, the upload is prevented. Example: ["jpg", "png", "bmp"].

Visibility: public
instantUpload boolean true

If false, no upload is triggered when a file is selected. In addition, if a file was selected, a new FileUploader instance is created to ensure that multiple files can be chosen.

Since: 1.30.0.

Visibility: public
maximumFileSize float

Specifies a file size limit in megabytes that prevents the upload if at least one file exceeds the limit. This property is not supported by Internet Explorer 8 and 9.

Visibility: public
maximumFilenameLength int

Specifies the maximum length of a file name. If the maximum file name length is exceeded, the corresponding event 'filenameLengthExceed' is triggered.

Visibility: public
mimeType string[]

Defines the allowed MIME types of files to be uploaded. The chosen files will be checked against an array of MIME types. If at least one file does not fit the MIME type requirements, the upload is prevented. This property is not supported by Internet Explorer 8 and 9. Example: mimeType ["image/png", "image/jpeg"].

Visibility: public
mode sap.m.ListMode None

Defines the selection mode of the control (e.g. None, SingleSelect, MultiSelect, SingleSelectLeft, SingleSelectMaster). Since the UploadCollection reacts like a list for attachments, the API is close to the ListBase Interface. sap.m.ListMode.Delete mode is not supported and will be automatically set to sap.m.ListMode.None. In addition, if instant upload is set to false the mode sap.m.ListMode.MultiSelect is not supported and will be automatically set to sap.m.ListMode.None.

Since: 1.34.0.

Visibility: public
multiple boolean false

Lets the user select multiple files from the same folder and then upload them. Internet Explorer 8 and 9 do not support this property. Please note 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.

If multiple property is set to false, the control shows an error message if more than one file is chosen for drag & drop.

Visibility: public
noDataDescription string

Allows you to set your own text for the 'No data' description label.

Since: 1.46.0.

Visibility: public
noDataText string

Allows you to set your own text for the 'No data' text label.

Visibility: public
numberOfAttachmentsText string

Sets the title text in the toolbar of the list of attachments. To show as well the number of attachments in brackets like the default text does. The number of attachments could be retrieved via "getItems().length". If a new title is set, the default is deactivated. The default value is set to language-dependent "Attachments (n)".

Since: 1.30.0.

Visibility: public
sameFilenameAllowed boolean false

Allows the user to use the same name for a file when editing the file name. 'Same name' refers to an already existing file name in the list.

Visibility: public
showSeparators sap.m.ListSeparators All

Defines whether separators are shown between list items.

Visibility: public
terminationEnabled boolean true

If true, the button that is used to terminate the instant file upload gets visible. The button normally appears when a file is being uploaded.

Since: 1.42.0.

Visibility: public
uploadButtonInvisible boolean false

If true, the button used for uploading files is invisible.

Since: 1.42.0.

Visibility: public
uploadEnabled boolean true

Enables the upload of a file. If property instantUpload is false it is not allowed to change uploadEnabled at runtime.

Visibility: public
uploadUrl string ../../../upload

Specifies the URL where the uploaded files have to be stored.

Visibility: public

Aggregations

Default Aggregation: items

Name Cardinality Type Description
_dragDropIcon 0..1 sap.ui.core.Icon

Internal aggregation to hold the drag and drop icon of indicator.

Since: 1.46.0.

_dragDropText 0..1 sap.m.Text

Internal aggregation to hold the drag and drop text of indicator.

Since: 1.46.0.

_list 0..1 sap.m.List

Internal aggregation to hold the list in controls tree.

Since: 1.34.0.

_noDataIcon 0..1 sap.ui.core.Icon

The icon is displayed in no data page

Since: 1.46.0.

headerParameters 0..n sap.m.UploadCollectionParameter

Specifies the header parameters for the FileUploader that are submitted only with XHR requests. Header parameters are not supported by Internet Explorer 8 and 9.

infoToolbar 0..1 sap.m.Toolbar

Specifies the info toolbar for filtering information. Sorting information will not displayed.

Since: 1.44.0.

items (default) 0..n sap.m.UploadCollectionItem

Uploaded items.

parameters 0..n sap.m.UploadCollectionParameter

Specifies the parameters for the FileUploader that are rendered as a hidden input field.

toolbar 0..1 sap.m.OverflowToolbar

Specifies the toolbar.

Since: 1.34.0.


Events Overview

Event Description
beforeUploadStarts

The event is triggered before the actual upload starts. An event is fired per file. All the necessary header parameters should be set here.

change

The event is triggered when files are selected in the FileUploader dialog. Applications can set parameters and headerParameters which will be dispatched to the embedded FileUploader control. Restriction: parameters and headerParameters are not supported by Internet Explorer 9.

fileDeleted

The event is triggered when an uploaded attachment is selected and the Delete button is pressed.

filenameLengthExceed

The event is triggered when the name of a chosen file is longer than the value specified with the maximumFilenameLength property (only if provided by the application).

fileRenamed

The event is triggered when the file name is changed.

fileSizeExceed

The event is triggered when the file size of an uploaded file is exceeded (only if the maxFileSize property was provided by the application). This event is not supported by Internet Explorer 9.

selectionChange

Fires when selection is changed via user interaction inside the control.

Since: 1.36.0.

typeMissmatch

The event is triggered when the file type or the MIME type don't match the permitted types (only if the fileType property or the mimeType property are provided by the application).

uploadComplete

The event is triggered as soon as the upload request is completed.

uploadTerminated

The event is triggered as soon as the upload request was terminated by the user.

beforeUploadStarts

The event is triggered before the actual upload starts. An event is fired per file. All the necessary header parameters should be set here.

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

Specifies the name of the file to be uploaded.

addHeaderParameter function

Adds a header parameter to the file that will be uploaded.

getHeaderParameter function

Returns the corresponding header parameter (type sap.m.UploadCollectionParameter) if available.

change

The event is triggered when files are selected in the FileUploader dialog. Applications can set parameters and headerParameters which will be dispatched to the embedded FileUploader control. Restriction: parameters and headerParameters are not supported by Internet Explorer 9.

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

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the files parameter instead.

files object[]

A FileList of individually selected files from the underlying system. See www.w3.org for the FileList Interface definition. Restriction: Internet Explorer 9 supports only single file with property file.name. Since version 1.28.0.

Since: 1.28.0.

fileDeleted

The event is triggered when an uploaded attachment is selected and the Delete button is pressed.

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

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the item parameter instead.

item sap.m.UploadCollectionItem

An item to be deleted from the collection. Since version 1.28.0.

Since: 1.28.0.

filenameLengthExceed

The event is triggered when the name of a chosen file is longer than the value specified with the maximumFilenameLength property (only if provided by the application).

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

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the files parameter instead.

files object[]

A FileList of individually selected files from the underlying system. Restriction: Internet Explorer 9 supports only single file with property file.name. Since version 1.28.0.

Since: 1.28.0.

fileRenamed

The event is triggered when the file name is changed.

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

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the item parameter instead.

fileName string

The new file name. This parameter is deprecated since 1.28.0. Use the item parameter instead.

item sap.m.UploadCollectionItem

The renamed UI element as an UploadCollectionItem. Since 1.28.0.

Since: 1.28.0.

fileSizeExceed

The event is triggered when the file size of an uploaded file is exceeded (only if the maxFileSize property was provided by the application). This event is not supported by Internet Explorer 9.

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

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the files parameter instead.

fileSize string

The size in MB of a file to be uploaded. This parameter is deprecated since 1.28.0. Use the files parameter instead.

files object[]

A FileList of individually selected files from the underlying system. Restriction: Internet Explorer 9 supports only single file with property file.name. Since 1.28.0.

Since: 1.28.0.

selectionChange

Fires when selection is changed via user interaction inside the control.

Since: 1.36.0.

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

The item whose selection has changed. In MultiSelect mode, only the topmost selected item is returned. This parameter can be used for single-selection modes.

selectedItems sap.m.UploadCollectionItem[]

Array of items whose selection has changed. This parameter can be used for MultiSelect mode.

selected boolean

Indicates whether the listItem parameter is selected or not.

typeMissmatch

The event is triggered when the file type or the MIME type don't match the permitted types (only if the fileType property or the mimeType property are provided by the application).

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

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the files parameter instead.

fileType string

File type. This parameter is deprecated since 1.28.0. Use the files parameter instead.

mimeType string

MIME type. This parameter is deprecated since 1.28.0. Use the files parameter instead.

files object[]

A FileList of individually selected files from the underlying system. Restriction: Internet Explorer 9 supports only single file. Since 1.28.0.

Since: 1.28.0.

uploadComplete

The event is triggered as soon as the upload request is completed.

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

Ready state XHR. This parameter is deprecated since 1.28.0. Use the files parameter instead.

response string

Response of the completed upload request. This parameter is deprecated since 1.28.0. Use the files parameter instead.

status string

Status Code of the completed upload event. This parameter is deprecated since 1.28.0. Use the files parameter instead.

files object[]

A list of uploaded files. Each entry contains the following members. fileName : The name of a file to be uploaded. response : 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. reponse : deprecated Since version 1.48.0. This parameter is deprecated, use parameter response instead. responseRaw : HTTP-Response which comes from the server. This property is not supported by Internet Explorer Versions lower than 9. status : Status of the XHR request. This property is not supported by Internet Explorer 9 and lower. headers : 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 header-object, with the property value reflecting the header-field's content. This property is not supported by Internet Explorer 9 and lower. Since 1.28.0.

Since: 1.28.0.

uploadTerminated

The event is triggered as soon as the upload request was terminated by the user.

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

Specifies the name of the file of which the upload is to be terminated.

getHeaderParameter function

This callback function returns the corresponding header parameter (type sap.m.UploadCollectionParameter) if available.


Methods Overview

Method Description
addHeaderParameter

Adds some headerParameter to the aggregation headerParameters.

addItem

Adds some item to the aggregation items.

addParameter

Adds some parameter to the aggregation parameters.

attachBeforeUploadStarts

Attaches event handler fnFunction to the beforeUploadStarts event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered before the actual upload starts. An event is fired per file. All the necessary header parameters should be set here.

attachChange

Attaches event handler fnFunction to the change event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when files are selected in the FileUploader dialog. Applications can set parameters and headerParameters which will be dispatched to the embedded FileUploader control. Restriction: parameters and headerParameters are not supported by Internet Explorer 9.

attachFileDeleted

Attaches event handler fnFunction to the fileDeleted event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when an uploaded attachment is selected and the Delete button is pressed.

attachFilenameLengthExceed

Attaches event handler fnFunction to the filenameLengthExceed event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when the name of a chosen file is longer than the value specified with the maximumFilenameLength property (only if provided by the application).

attachFileRenamed

Attaches event handler fnFunction to the fileRenamed event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when the file name is changed.

attachFileSizeExceed

Attaches event handler fnFunction to the fileSizeExceed event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when the file size of an uploaded file is exceeded (only if the maxFileSize property was provided by the application). This event is not supported by Internet Explorer 9.

attachSelectionChange

Attaches event handler fnFunction to the selectionChange event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

Fires when selection is changed via user interaction inside the control.

attachTypeMissmatch

Attaches event handler fnFunction to the typeMissmatch event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when the file type or the MIME type don't match the permitted types (only if the fileType property or the mimeType property are provided by the application).

attachUploadComplete

Attaches event handler fnFunction to the uploadComplete event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered as soon as the upload request is completed.

attachUploadTerminated

Attaches event handler fnFunction to the uploadTerminated event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered as soon as the upload request was terminated by the user.

bindItems

Binds aggregation items to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

destroyHeaderParameters

Destroys all the headerParameters in the aggregation headerParameters.

destroyInfoToolbar

Destroys the infoToolbar in the aggregation infoToolbar.

destroyItems

Destroys all the items in the aggregation items.

destroyParameters

Destroys all the parameters in the aggregation parameters.

destroyToolbar

Destroys the toolbar in the aggregation toolbar.

detachBeforeUploadStarts

Detaches event handler fnFunction from the beforeUploadStarts event of this sap.m.UploadCollection.

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

detachChange

Detaches event handler fnFunction from the change event of this sap.m.UploadCollection.

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

detachFileDeleted

Detaches event handler fnFunction from the fileDeleted event of this sap.m.UploadCollection.

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.m.UploadCollection.

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

detachFileRenamed

Detaches event handler fnFunction from the fileRenamed event of this sap.m.UploadCollection.

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.m.UploadCollection.

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

detachSelectionChange

Detaches event handler fnFunction from the selectionChange event of this sap.m.UploadCollection.

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.m.UploadCollection.

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.m.UploadCollection.

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

detachUploadTerminated

Detaches event handler fnFunction from the uploadTerminated event of this sap.m.UploadCollection.

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

downloadItem

Downloads the given item. This function delegates to uploadCollectionItem.download.

sap.m.UploadCollection.extend

Creates a new subclass of class sap.m.UploadCollection 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.

fireBeforeUploadStarts

Fires event beforeUploadStarts to attached listeners.

fireChange

Fires event change to attached listeners.

fireFileDeleted

Fires event fileDeleted to attached listeners.

fireFilenameLengthExceed

Fires event filenameLengthExceed to attached listeners.

fireFileRenamed

Fires event fileRenamed to attached listeners.

fireFileSizeExceed

Fires event fileSizeExceed to attached listeners.

fireSelectionChange

Fires event selectionChange to attached listeners.

fireTypeMissmatch

Fires event typeMissmatch to attached listeners.

fireUploadComplete

Fires event uploadComplete to attached listeners.

fireUploadTerminated

Fires event uploadTerminated to attached listeners.

getFileType

Gets current value of property fileType.

Defines the allowed file types for the upload. The chosen files will be checked against an array of file types. If at least one file does not fit the file type requirements, the upload is prevented. Example: ["jpg", "png", "bmp"].

getHeaderParameters

Gets content of aggregation headerParameters.

Specifies the header parameters for the FileUploader that are submitted only with XHR requests. Header parameters are not supported by Internet Explorer 8 and 9.

getInfoToolbar

Gets content of aggregation infoToolbar.

Specifies the info toolbar for filtering information. Sorting information will not displayed.

getInstantUpload

Gets current value of property instantUpload.

If false, no upload is triggered when a file is selected. In addition, if a file was selected, a new FileUploader instance is created to ensure that multiple files can be chosen.

Default value is true.

getInternalRequestHeaderNames

Provides access to the internally used request headers to allow adding them to the "Access-Control-Allow-Headers" header parameter if needed.

getItems

Gets content of aggregation items.

Uploaded items.

getMaximumFilenameLength

Gets current value of property maximumFilenameLength.

Specifies the maximum length of a file name. If the maximum file name length is exceeded, the corresponding event 'filenameLengthExceed' is triggered.

getMaximumFileSize

Gets current value of property maximumFileSize.

Specifies a file size limit in megabytes that prevents the upload if at least one file exceeds the limit. This property is not supported by Internet Explorer 8 and 9.

sap.m.UploadCollection.getMetadata

Returns a metadata object for class sap.m.UploadCollection.

getMimeType

Gets current value of property mimeType.

Defines the allowed MIME types of files to be uploaded. The chosen files will be checked against an array of MIME types. If at least one file does not fit the MIME type requirements, the upload is prevented. This property is not supported by Internet Explorer 8 and 9. Example: mimeType ["image/png", "image/jpeg"].

getMode

Gets current value of property mode.

Defines the selection mode of the control (e.g. None, SingleSelect, MultiSelect, SingleSelectLeft, SingleSelectMaster). Since the UploadCollection reacts like a list for attachments, the API is close to the ListBase Interface. sap.m.ListMode.Delete mode is not supported and will be automatically set to sap.m.ListMode.None. In addition, if instant upload is set to false the mode sap.m.ListMode.MultiSelect is not supported and will be automatically set to sap.m.ListMode.None.

Default value is "None".

getMultiple

Gets current value of property multiple.

Lets the user select multiple files from the same folder and then upload them. Internet Explorer 8 and 9 do not support this property. Please note 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.

If multiple property is set to false, the control shows an error message if more than one file is chosen for drag & drop.

Default value is false.

getNoDataDescription

Gets current value of property noDataDescription.

Allows you to set your own text for the 'No data' description label.

getNoDataText

Gets current value of property noDataText.

Allows you to set your own text for the 'No data' text label.

getNumberOfAttachmentsText

Gets current value of property numberOfAttachmentsText.

Sets the title text in the toolbar of the list of attachments. To show as well the number of attachments in brackets like the default text does. The number of attachments could be retrieved via "getItems().length". If a new title is set, the default is deactivated. The default value is set to language-dependent "Attachments (n)".

getParameters

Gets content of aggregation parameters.

Specifies the parameters for the FileUploader that are rendered as a hidden input field.

getSameFilenameAllowed

Gets current value of property sameFilenameAllowed.

Allows the user to use the same name for a file when editing the file name. 'Same name' refers to an already existing file name in the list.

Default value is false.

getSelectedItem

Retrieves the currently selected UploadCollectionItem.

getSelectedItems

Returns an array containing the selected UploadCollectionItems.

getShowSeparators

Gets current value of property showSeparators.

Defines whether separators are shown between list items.

Default value is "All".

getTerminationEnabled

Gets current value of property terminationEnabled.

If true, the button that is used to terminate the instant file upload gets visible. The button normally appears when a file is being uploaded.

Default value is true.

getToolbar

Gets content of aggregation toolbar.

Specifies the toolbar.

getUploadButtonInvisible

Gets current value of property uploadButtonInvisible.

If true, the button used for uploading files is invisible.

Default value is false.

getUploadEnabled

Gets current value of property uploadEnabled.

Enables the upload of a file. If property instantUpload is false it is not allowed to change uploadEnabled at runtime.

Default value is true.

getUploadUrl

Gets current value of property uploadUrl.

Specifies the URL where the uploaded files have to be stored.

Default value is "../../../upload".

indexOfHeaderParameter

Checks for the provided sap.m.UploadCollectionParameter in the aggregation headerParameters. and returns its index if found or -1 otherwise.

indexOfItem

Checks for the provided sap.m.UploadCollectionItem in the aggregation items. and returns its index if found or -1 otherwise.

indexOfParameter

Checks for the provided sap.m.UploadCollectionParameter in the aggregation parameters. and returns its index if found or -1 otherwise.

insertHeaderParameter

Inserts a headerParameter into the aggregation headerParameters.

insertItem

Inserts a item into the aggregation items.

insertParameter

Inserts a parameter into the aggregation parameters.

openFileDialog

Opens the FileUploader dialog. When an UploadCollectionItem is provided, this method can be used to update a file with a new version. In this case, the upload progress can be sequenced using the events: beforeUploadStarts, uploadComplete and uploadTerminated. For this use, multiple properties from the UploadCollection have to be set to false. If no UploadCollectionItem is provided, only the dialog opens and no further configuration of the UploadCollection is needed.

removeAllHeaderParameters

Removes all the controls from the aggregation headerParameters.

Additionally, it unregisters them from the hosting UIArea.

removeAllItems

Removes all the controls from the aggregation items.

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.

removeHeaderParameter

Removes a headerParameter from the aggregation headerParameters.

removeItem

Removes a item from the aggregation items.

removeParameter

Removes a parameter from the aggregation parameters.

selectAll

Select all items in "MultiSelection" mode.

setFileType

Sets a new value for property fileType.

Defines the allowed file types for the upload. The chosen files will be checked against an array of file types. If at least one file does not fit the file type requirements, the upload is prevented. Example: ["jpg", "png", "bmp"].

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

setInfoToolbar

Sets the aggregated infoToolbar.

setInstantUpload

Sets a new value for property instantUpload.

If false, no upload is triggered when a file is selected. In addition, if a file was selected, a new FileUploader instance is created to ensure that multiple files can be chosen.

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

Default value is true.

setMaximumFilenameLength

Sets a new value for property maximumFilenameLength.

Specifies the maximum length of a file name. If the maximum file name length is exceeded, the corresponding event 'filenameLengthExceed' is triggered.

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.

Specifies a file size limit in megabytes that prevents the upload if at least one file exceeds the limit. This property is not supported by Internet Explorer 8 and 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.

Defines the allowed MIME types of files to be uploaded. The chosen files will be checked against an array of MIME types. If at least one file does not fit the MIME type requirements, the upload is prevented. This property is not supported by Internet Explorer 8 and 9. Example: mimeType ["image/png", "image/jpeg"].

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

setMode

Sets a new value for property mode.

Defines the selection mode of the control (e.g. None, SingleSelect, MultiSelect, SingleSelectLeft, SingleSelectMaster). Since the UploadCollection reacts like a list for attachments, the API is close to the ListBase Interface. sap.m.ListMode.Delete mode is not supported and will be automatically set to sap.m.ListMode.None. In addition, if instant upload is set to false the mode sap.m.ListMode.MultiSelect is not supported and will be automatically set to sap.m.ListMode.None.

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

Default value is "None".

setMultiple

Sets a new value for property multiple.

Lets the user select multiple files from the same folder and then upload them. Internet Explorer 8 and 9 do not support this property. Please note 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.

If multiple property is set to false, the control shows an error message if more than one file is chosen for drag & drop.

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

Default value is false.

setNoDataDescription

Sets a new value for property noDataDescription.

Allows you to set your own text for the 'No data' description label.

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

setNoDataText

Sets a new value for property noDataText.

Allows you to set your own text for the 'No data' text label.

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

setNumberOfAttachmentsText

Sets a new value for property numberOfAttachmentsText.

Sets the title text in the toolbar of the list of attachments. To show as well the number of attachments in brackets like the default text does. The number of attachments could be retrieved via "getItems().length". If a new title is set, the default is deactivated. The default value is set to language-dependent "Attachments (n)".

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.

Allows the user to use the same name for a file when editing the file name. 'Same name' refers to an already existing file name in the list.

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

Default value is false.

setSelectedItem

Selects or deselects the given list item.

setSelectedItemById

Sets an UploadCollectionItem to be selected by ID. In single selection mode, the method removes the previous selection.

setShowSeparators

Sets a new value for property showSeparators.

Defines whether separators are shown between list items.

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

Default value is "All".

setTerminationEnabled

Sets a new value for property terminationEnabled.

If true, the button that is used to terminate the instant file upload gets visible. The button normally appears when a file is being uploaded.

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

Default value is true.

setToolbar

Sets the aggregated toolbar.

setUploadButtonInvisible

Sets a new value for property uploadButtonInvisible.

If true, the button used for uploading files is invisible.

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

Default value is false.

setUploadEnabled

Sets a new value for property uploadEnabled.

Enables the upload of a file. If property instantUpload is false it is not allowed to change uploadEnabled at runtime.

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

Default value is true.

setUploadUrl

Sets a new value for property uploadUrl.

Specifies the URL where the uploaded files have to be stored.

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

Default value is "../../../upload".

unbindItems

Unbinds aggregation items from model data.

upload

Starts the upload for all selected files.

addHeaderParameter

Adds some headerParameter to the aggregation headerParameters.

Param Type DefaultValue Description
oHeaderParameter sap.m.UploadCollectionParameter

The headerParameter to add; if empty, nothing is inserted

addItem

Adds some item to the aggregation items.

Param Type DefaultValue Description
oItem sap.m.UploadCollectionItem

The item to add; if empty, nothing is inserted

addParameter

Adds some parameter to the aggregation parameters.

Param Type DefaultValue Description
oParameter sap.m.UploadCollectionParameter

The parameter to add; if empty, nothing is inserted

attachBeforeUploadStarts

Attaches event handler fnFunction to the beforeUploadStarts event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered before the actual upload starts. An event is fired per file. All the necessary header parameters should be set here.

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.m.UploadCollection itself

attachChange

Attaches event handler fnFunction to the change event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when files are selected in the FileUploader dialog. Applications can set parameters and headerParameters which will be dispatched to the embedded FileUploader control. Restriction: parameters and headerParameters are not supported by 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.m.UploadCollection itself

attachFileDeleted

Attaches event handler fnFunction to the fileDeleted event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when an uploaded attachment is selected and the Delete button 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.m.UploadCollection itself

attachFilenameLengthExceed

Attaches event handler fnFunction to the filenameLengthExceed event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when the name of a chosen file is longer than the value specified with the maximumFilenameLength property (only if provided by the application).

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.m.UploadCollection itself

attachFileRenamed

Attaches event handler fnFunction to the fileRenamed event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when the file name is changed.

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.m.UploadCollection itself

attachFileSizeExceed

Attaches event handler fnFunction to the fileSizeExceed event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when the file size of an uploaded file is exceeded (only if the maxFileSize property was provided by the application). This event is not supported by 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.m.UploadCollection itself

attachSelectionChange

Attaches event handler fnFunction to the selectionChange event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

Fires when selection is changed via user interaction inside the control.

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.m.UploadCollection itself

attachTypeMissmatch

Attaches event handler fnFunction to the typeMissmatch event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered when the file type or the MIME type don't match the permitted types (only if the fileType property or the mimeType property are provided by the application).

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.m.UploadCollection itself

attachUploadComplete

Attaches event handler fnFunction to the uploadComplete event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered as soon as the upload request is completed.

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.m.UploadCollection itself

attachUploadTerminated

Attaches event handler fnFunction to the uploadTerminated event of this sap.m.UploadCollection.

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.m.UploadCollection itself.

The event is triggered as soon as the upload request was terminated by the user.

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.m.UploadCollection itself

bindItems

Binds aggregation items to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

Param Type DefaultValue Description
oBindingInfo sap.ui.base.ManagedObject.AggregationBindingInfo

The binding information

destroyHeaderParameters

Destroys all the headerParameters in the aggregation headerParameters.

destroyInfoToolbar

Destroys the infoToolbar in the aggregation infoToolbar.

destroyItems

Destroys all the items in the aggregation items.

destroyParameters

Destroys all the parameters in the aggregation parameters.

destroyToolbar

Destroys the toolbar in the aggregation toolbar.

detachBeforeUploadStarts

Detaches event handler fnFunction from the beforeUploadStarts event of this sap.m.UploadCollection.

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

detachChange

Detaches event handler fnFunction from the change event of this sap.m.UploadCollection.

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

detachFileDeleted

Detaches event handler fnFunction from the fileDeleted event of this sap.m.UploadCollection.

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.m.UploadCollection.

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

detachFileRenamed

Detaches event handler fnFunction from the fileRenamed event of this sap.m.UploadCollection.

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.m.UploadCollection.

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

detachSelectionChange

Detaches event handler fnFunction from the selectionChange event of this sap.m.UploadCollection.

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.m.UploadCollection.

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.m.UploadCollection.

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

detachUploadTerminated

Detaches event handler fnFunction from the uploadTerminated event of this sap.m.UploadCollection.

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

downloadItem

Downloads the given item. This function delegates to uploadCollectionItem.download.

Param Type DefaultValue Description
uploadCollectionItem sap.m.UploadCollectionItem

The item to download. This parameter is mandatory.

askForLocation boolean

Decides whether to ask for a location to download or not.

sap.m.UploadCollection.extend

Creates a new subclass of class sap.m.UploadCollection 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

fireBeforeUploadStarts

Fires event beforeUploadStarts to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fileName string

Specifies the name of the file to be uploaded.

addHeaderParameter function

Adds a header parameter to the file that will be uploaded.

getHeaderParameter function

Returns the corresponding header parameter (type sap.m.UploadCollectionParameter) if available.

fireChange

Fires event change to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

documentId string

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the files parameter instead.

files object[]

A FileList of individually selected files from the underlying system. See www.w3.org for the FileList Interface definition. Restriction: Internet Explorer 9 supports only single file with property file.name. Since version 1.28.0.

fireFileDeleted

Fires event fileDeleted to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

documentId string

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the item parameter instead.

item sap.m.UploadCollectionItem

An item to be deleted from the collection. Since version 1.28.0.

fireFilenameLengthExceed

Fires event filenameLengthExceed to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

documentId string

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the files parameter instead.

files object[]

A FileList of individually selected files from the underlying system. Restriction: Internet Explorer 9 supports only single file with property file.name. Since version 1.28.0.

fireFileRenamed

Fires event fileRenamed to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

documentId string

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the item parameter instead.

fileName string

The new file name. This parameter is deprecated since 1.28.0. Use the item parameter instead.

item sap.m.UploadCollectionItem

The renamed UI element as an UploadCollectionItem. Since 1.28.0.

fireFileSizeExceed

Fires event fileSizeExceed to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

documentId string

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the files parameter instead.

fileSize string

The size in MB of a file to be uploaded. This parameter is deprecated since 1.28.0. Use the files parameter instead.

files object[]

A FileList of individually selected files from the underlying system. Restriction: Internet Explorer 9 supports only single file with property file.name. Since 1.28.0.

fireSelectionChange

Fires event selectionChange to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

selectedItem sap.m.UploadCollectionItem

The item whose selection has changed. In MultiSelect mode, only the topmost selected item is returned. This parameter can be used for single-selection modes.

selectedItems sap.m.UploadCollectionItem[]

Array of items whose selection has changed. This parameter can be used for MultiSelect mode.

selected boolean

Indicates whether the listItem parameter is selected or not.

fireTypeMissmatch

Fires event typeMissmatch to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

documentId string

A unique Id of the attached document. This parameter is deprecated since 1.28.0. Use the files parameter instead.

fileType string

File type. This parameter is deprecated since 1.28.0. Use the files parameter instead.

mimeType string

MIME type. This parameter is deprecated since 1.28.0. Use the files parameter instead.

files object[]

A FileList of individually selected files from the underlying system. Restriction: Internet Explorer 9 supports only single file. Since 1.28.0.

fireUploadComplete

Fires event uploadComplete to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

readyStateXHR string

Ready state XHR. This parameter is deprecated since 1.28.0. Use the files parameter instead.

response string

Response of the completed upload request. This parameter is deprecated since 1.28.0. Use the files parameter instead.

status string

Status Code of the completed upload event. This parameter is deprecated since 1.28.0. Use the files parameter instead.

files object[]

A list of uploaded files. Each entry contains the following members. fileName : The name of a file to be uploaded. response : 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. reponse : deprecated Since version 1.48.0. This parameter is deprecated, use parameter response instead. responseRaw : HTTP-Response which comes from the server. This property is not supported by Internet Explorer Versions lower than 9. status : Status of the XHR request. This property is not supported by Internet Explorer 9 and lower. headers : 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 header-object, with the property value reflecting the header-field's content. This property is not supported by Internet Explorer 9 and lower. Since 1.28.0.

fireUploadTerminated

Fires event uploadTerminated to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fileName string

Specifies the name of the file of which the upload is to be terminated.

getHeaderParameter function

This callback function returns the corresponding header parameter (type sap.m.UploadCollectionParameter) if available.

getFileType

Gets current value of property fileType.

Defines the allowed file types for the upload. The chosen files will be checked against an array of file types. If at least one file does not fit the file type requirements, the upload is prevented. Example: ["jpg", "png", "bmp"].

getHeaderParameters

Gets content of aggregation headerParameters.

Specifies the header parameters for the FileUploader that are submitted only with XHR requests. Header parameters are not supported by Internet Explorer 8 and 9.

getInfoToolbar

Gets content of aggregation infoToolbar.

Specifies the info toolbar for filtering information. Sorting information will not displayed.

getInstantUpload

Gets current value of property instantUpload.

If false, no upload is triggered when a file is selected. In addition, if a file was selected, a new FileUploader instance is created to ensure that multiple files can be chosen.

Default value is true.

getInternalRequestHeaderNames

Provides access to the internally used request headers to allow adding them to the "Access-Control-Allow-Headers" header parameter if needed.

getItems

Gets content of aggregation items.

Uploaded items.

getMaximumFilenameLength

Gets current value of property maximumFilenameLength.

Specifies the maximum length of a file name. If the maximum file name length is exceeded, the corresponding event 'filenameLengthExceed' is triggered.

getMaximumFileSize

Gets current value of property maximumFileSize.

Specifies a file size limit in megabytes that prevents the upload if at least one file exceeds the limit. This property is not supported by Internet Explorer 8 and 9.

sap.m.UploadCollection.getMetadata

Returns a metadata object for class sap.m.UploadCollection.

getMimeType

Gets current value of property mimeType.

Defines the allowed MIME types of files to be uploaded. The chosen files will be checked against an array of MIME types. If at least one file does not fit the MIME type requirements, the upload is prevented. This property is not supported by Internet Explorer 8 and 9. Example: mimeType ["image/png", "image/jpeg"].

getMode

Gets current value of property mode.

Defines the selection mode of the control (e.g. None, SingleSelect, MultiSelect, SingleSelectLeft, SingleSelectMaster). Since the UploadCollection reacts like a list for attachments, the API is close to the ListBase Interface. sap.m.ListMode.Delete mode is not supported and will be automatically set to sap.m.ListMode.None. In addition, if instant upload is set to false the mode sap.m.ListMode.MultiSelect is not supported and will be automatically set to sap.m.ListMode.None.

Default value is "None".

getMultiple

Gets current value of property multiple.

Lets the user select multiple files from the same folder and then upload them. Internet Explorer 8 and 9 do not support this property. Please note 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.

If multiple property is set to false, the control shows an error message if more than one file is chosen for drag & drop.

Default value is false.

getNoDataDescription

Gets current value of property noDataDescription.

Allows you to set your own text for the 'No data' description label.

getNoDataText

Gets current value of property noDataText.

Allows you to set your own text for the 'No data' text label.

getNumberOfAttachmentsText

Gets current value of property numberOfAttachmentsText.

Sets the title text in the toolbar of the list of attachments. To show as well the number of attachments in brackets like the default text does. The number of attachments could be retrieved via "getItems().length". If a new title is set, the default is deactivated. The default value is set to language-dependent "Attachments (n)".

getParameters

Gets content of aggregation parameters.

Specifies the parameters for the FileUploader that are rendered as a hidden input field.

getSameFilenameAllowed

Gets current value of property sameFilenameAllowed.

Allows the user to use the same name for a file when editing the file name. 'Same name' refers to an already existing file name in the list.

Default value is false.

getSelectedItem

Retrieves the currently selected UploadCollectionItem.

getSelectedItems

Returns an array containing the selected UploadCollectionItems.

getShowSeparators

Gets current value of property showSeparators.

Defines whether separators are shown between list items.

Default value is "All".

getTerminationEnabled

Gets current value of property terminationEnabled.

If true, the button that is used to terminate the instant file upload gets visible. The button normally appears when a file is being uploaded.

Default value is true.

getToolbar

Gets content of aggregation toolbar.

Specifies the toolbar.

getUploadButtonInvisible

Gets current value of property uploadButtonInvisible.

If true, the button used for uploading files is invisible.

Default value is false.

getUploadEnabled

Gets current value of property uploadEnabled.

Enables the upload of a file. If property instantUpload is false it is not allowed to change uploadEnabled at runtime.

Default value is true.

getUploadUrl

Gets current value of property uploadUrl.

Specifies the URL where the uploaded files have to be stored.

Default value is "../../../upload".

indexOfHeaderParameter

Checks for the provided sap.m.UploadCollectionParameter in the aggregation headerParameters. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oHeaderParameter sap.m.UploadCollectionParameter

The headerParameter whose index is looked for

indexOfItem

Checks for the provided sap.m.UploadCollectionItem in the aggregation items. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oItem sap.m.UploadCollectionItem

The item whose index is looked for

indexOfParameter

Checks for the provided sap.m.UploadCollectionParameter in the aggregation parameters. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oParameter sap.m.UploadCollectionParameter

The parameter whose index is looked for

insertHeaderParameter

Inserts a headerParameter into the aggregation headerParameters.

Param Type DefaultValue Description
oHeaderParameter sap.m.UploadCollectionParameter

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

insertItem

Inserts a item into the aggregation items.

Param Type DefaultValue Description
oItem sap.m.UploadCollectionItem

The item to insert; if empty, nothing is inserted

iIndex int

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

insertParameter

Inserts a parameter into the aggregation parameters.

Param Type DefaultValue Description
oParameter sap.m.UploadCollectionParameter

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

openFileDialog

Opens the FileUploader dialog. When an UploadCollectionItem is provided, this method can be used to update a file with a new version. In this case, the upload progress can be sequenced using the events: beforeUploadStarts, uploadComplete and uploadTerminated. For this use, multiple properties from the UploadCollection have to be set to false. If no UploadCollectionItem is provided, only the dialog opens and no further configuration of the UploadCollection is needed.

Param Type DefaultValue Description
item sap.m.UploadCollectionItem

The item to update with a new version. This parameter is mandatory.

removeAllHeaderParameters

Removes all the controls from the aggregation headerParameters.

Additionally, it unregisters them from the hosting UIArea.

removeAllItems

Removes all the controls from the aggregation items.

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.

removeHeaderParameter

Removes a headerParameter from the aggregation headerParameters.

Param Type DefaultValue Description
vHeaderParameter int string sap.m.UploadCollectionParameter

The headerParameter to remove or its index or id

removeItem

Removes a item from the aggregation items.

Param Type DefaultValue Description
vItem int string sap.m.UploadCollectionItem

The item to remove or its index or id

removeParameter

Removes a parameter from the aggregation parameters.

Param Type DefaultValue Description
vParameter int string sap.m.UploadCollectionParameter

The parameter to remove or its index or id

selectAll

Select all items in "MultiSelection" mode.

setFileType

Sets a new value for property fileType.

Defines the allowed file types for the upload. The chosen files will be checked against an array of file types. If at least one file does not fit the file type requirements, the upload is prevented. 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

setInfoToolbar

Sets the aggregated infoToolbar.

Param Type DefaultValue Description
oInfoToolbar sap.m.Toolbar

The infoToolbar to set

setInstantUpload

Sets a new value for property instantUpload.

If false, no upload is triggered when a file is selected. In addition, if a file was selected, a new FileUploader instance is created to ensure that multiple files can be chosen.

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
bInstantUpload boolean true

New value for property instantUpload

setMaximumFilenameLength

Sets a new value for property maximumFilenameLength.

Specifies the maximum length of a file name. If the maximum file name length is exceeded, the corresponding event 'filenameLengthExceed' is triggered.

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.

Specifies a file size limit in megabytes that prevents the upload if at least one file exceeds the limit. This property is not supported by Internet Explorer 8 and 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.

Defines the allowed MIME types of files to be uploaded. The chosen files will be checked against an array of MIME types. If at least one file does not fit the MIME type requirements, the upload is prevented. This property is not supported by Internet Explorer 8 and 9. Example: mimeType ["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

setMode

Sets a new value for property mode.

Defines the selection mode of the control (e.g. None, SingleSelect, MultiSelect, SingleSelectLeft, SingleSelectMaster). Since the UploadCollection reacts like a list for attachments, the API is close to the ListBase Interface. sap.m.ListMode.Delete mode is not supported and will be automatically set to sap.m.ListMode.None. In addition, if instant upload is set to false the mode sap.m.ListMode.MultiSelect is not supported and will be automatically set to sap.m.ListMode.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
sMode sap.m.ListMode "None"

New value for property mode

setMultiple

Sets a new value for property multiple.

Lets the user select multiple files from the same folder and then upload them. Internet Explorer 8 and 9 do not support this property. Please note 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.

If multiple property is set to false, the control shows an error message if more than one file is chosen for drag & drop.

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

setNoDataDescription

Sets a new value for property noDataDescription.

Allows you to set your own text for the 'No data' description label.

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

Param Type DefaultValue Description
sNoDataDescription string

New value for property noDataDescription

setNoDataText

Sets a new value for property noDataText.

Allows you to set your own text for the 'No data' text label.

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

Param Type DefaultValue Description
sNoDataText string

New value for property noDataText

setNumberOfAttachmentsText

Sets a new value for property numberOfAttachmentsText.

Sets the title text in the toolbar of the list of attachments. To show as well the number of attachments in brackets like the default text does. The number of attachments could be retrieved via "getItems().length". If a new title is set, the default is deactivated. The default value is set to language-dependent "Attachments (n)".

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

Param Type DefaultValue Description
sNumberOfAttachmentsText string

New value for property numberOfAttachmentsText

setSameFilenameAllowed

Sets a new value for property sameFilenameAllowed.

Allows the user to use the same name for a file when editing the file name. 'Same name' refers to an already existing file name in the list.

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

setSelectedItem

Selects or deselects the given list item.

Param Type DefaultValue Description
uploadCollectionItem sap.m.UploadCollectionItem

The item whose selection is to be changed. This parameter is mandatory.

select boolean true

The selection state of the item.

setSelectedItemById

Sets an UploadCollectionItem to be selected by ID. In single selection mode, the method removes the previous selection.

Param Type DefaultValue Description
id string

The ID of the item whose selection is to be changed.

select boolean true

The selection state of the item.

setShowSeparators

Sets a new value for property showSeparators.

Defines whether separators are shown between list items.

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

Default value is "All".

Param Type DefaultValue Description
sShowSeparators sap.m.ListSeparators "All"

New value for property showSeparators

setTerminationEnabled

Sets a new value for property terminationEnabled.

If true, the button that is used to terminate the instant file upload gets visible. The button normally appears when a file is being uploaded.

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
bTerminationEnabled boolean true

New value for property terminationEnabled

setToolbar

Sets the aggregated toolbar.

Param Type DefaultValue Description
oToolbar sap.m.OverflowToolbar

The toolbar to set

setUploadButtonInvisible

Sets a new value for property uploadButtonInvisible.

If true, the button used for uploading files is invisible.

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
bUploadButtonInvisible boolean false

New value for property uploadButtonInvisible

setUploadEnabled

Sets a new value for property uploadEnabled.

Enables the upload of a file. If property instantUpload is false it is not allowed to change uploadEnabled at runtime.

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
bUploadEnabled boolean true

New value for property uploadEnabled

setUploadUrl

Sets a new value for property uploadUrl.

Specifies the URL where the uploaded files have to be stored.

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

Default value is "../../../upload".

Param Type DefaultValue Description
sUploadUrl string "../../../upload"

New value for property uploadUrl

unbindItems

Unbinds aggregation items from model data.

upload

Starts the upload for all selected files.