Updated: March 18, 2021

Upload Collection

sap.m.UploadCollection

Intro

The upload collection control allows users to upload single or multiple files from a device (desktop, tablet, or phone) to the SAP Fiori app. Typically, uploaded files appear in an Attachments tab. However, files can also be displayed elsewhere.

Information
The upload collection replaces the deprecated sap.ca.ui.FileUpload control. Please refrain from using the old CA control.

Usage

Use the upload collection control if:

  • You want to show a list of uploaded files that can be modified.
  • You want to allow users to add or remove files, and to change the file names.
  • You are still using the old sap.ca.ui.FileUpload control.

Do not use the upload collection control if:

Responsiveness

The upload collection control supports small, medium, and large containers.

Upload collection – Size S
Upload collection – Size S
Upload collection – Size M
Upload collection – Size M
Upload collection – Size L/XL
Upload collection – Size L/XL

Layout

The toolbar at the top of the upload collection control has an Attachments header and a counter on the left, and an Add button ( ) for adding new items on the right.

Files are listed vertically. Each item has a Rename ( ) and a Remove ( ) button.

While most file types have generic icons (for example documents, spreadsheets, or presentations), image files have a small thumbnail preview.

Layout – Items
Layout – Items

Attributes and Statuses

You can display additional attributes and statuses below the file name. Attributes can include the name of the person who uploaded the file, the upload date, the version number, file size, and so on.

App developers can also set individual statuses. These statuses usually refer to an object’s state in a workflow (such as Approved or Overdue).

If multiple attributes or statuses are displayed, they are separated by a bullet.

Layout – Attributes and statuses
Layout – Attributes and statuses

Types

The upload collection control offers two different modes: UploadCollection and UploadCollectionForPendingUpload.

The classic upload collection allows users to upload single or multiple files directly to the app, where these files are displayed as a list.

In contrast, the upload collection for pending upload requires the user to first add multiple files to a list (usually presented in a dialog) and then explicitly trigger the upload for the entire list.

When the dialog with the list is confirmed, the user returns to the app screen with the upload collection set to busy until the upload is finished.

Behavior and Interaction

Uploading Files

The Add button ( ) triggers a native operating system dialog that allows users to select the files they want to upload. You can decide whether the dialogs should allow users to select multiple items, or only one item.

Interaction – Upload (1)
Interaction – Upload (1)

Once the files have been selected and the dialog has been closed, the uploading process is shown in the list.

Users can cancel individual uploads by pressing the Remove  button provided on each item.

Interaction – Upload (3)
Interaction – Upload (3)
Information
Before version 1.32, all uploads are bundled into a single request. As a result, all uploads show the same progress and, if one of them is cancelled, all of them are aborted. Version 1.32 fixes this.

Opening Files

The user can click or tap the icons or thumbnails in front of the attachment. Opening files is handled differently depending on the operating system.

On a desktop device, clicking the file name or icon of a file opens the respective program that has been assigned to this file type. Mobile devices usually open a dialog in which the user can select an app that supports this file type.

Renaming Files

The rename function works identically on desktop and mobile devices.

The user clicks or taps the Rename button.

The file name becomes an input field in which the existing name is highlighted. At the same time, the Rename and Delete buttons are replaced by two options: OK and Cancel.

When the user starts typing, the highlighted text is overwritten. Alternatively, the user can use the mouse or keyboard to change the selected text.

There are three ways in which to validate the new file name:

  • The user clicks or taps somewhere outside the input field to change the focus.
  • The user clicks OK.
  • The user presses ENTER.

Editing Files

If users need to edit more than just the name of uploaded files, applications can implement an edit dialog with all the elements that can be changed by the user.

The image shows an example of how to structure such a dialog. The fields depend entirely on the use case and can be freely determined by each application.

Further details about editing parts of an object in a dialog can be found in the article manage objects – parts of an object. If multiple files need to be edited simultaneously, make sure to follow the guidelines for mass editing.

Interaction - Example of edit dialog
Interaction - Example of edit dialog

Deleting Files

The delete function works identically on desktop and mobile devices.

As soon as the user clicks or taps the Delete button on a file, a dialog appears asking the user to confirm the deletion of the respective file.

The file name has to be specified in the dialog. Delete confirms the deletion and the file is removed from the list. Cancel aborts the process, closes the dialog, and brings the user back to the file list without making any changes.

Interaction – Delete
Interaction – Delete

Handling Duplicates

Some applications may allow duplicate files and file names. This section covers steps to prevent duplicates.

Duplicate File Name During Renaming

In this example, there are two different image files: Product Picture – Front and Product Picture – Back.

The user types in a name that is identical to one that already exists.

When the user clicks OK or tries to remove the focus from the input field, the field is highlighted (semantic color: error).

Duplicate Files During Upload

Information
Duplicate files are not recognized by the upload control. If needed, this feature must be implemented manually.

If a duplicate is recognized during the upload process, a dialog appears that allows the user to do one of the following:

1) This text explains the current conflict (no actions possible).

2) With Upload and replace, the current file is replaced with the newly updated one.

3) With Upload and rename automatically, the current file is kept and an incrementally increasing number is added to the newly uploaded file, such as “Technical Specs_2”.

4) With Skip this file, the file is not uploaded and the current file is kept instead.

5) If Do this for all n conflicts is checked, the selected action is applied to all remaining conflicts.

6) The OK button confirms selected action(s).

7) The Cancel button cancels the entire upload process.

Interaction – Upload duplicate – Details
Interaction – Upload duplicate – Details

Styles

The showSeparators property allows you to display dividers between each item. The default value is All, meaning that all dividers are shown. We recommend that you only turn off the separators if you expect to have just a few items since they can help to maintain a better overview in long lists.

Styles – Separators (default)
Styles – Separators (default)
Styles – No separators
Styles – No separators

Guidelines

When to Show/Deactivate/Hide Actions

Apps can control the visibility and the active state for all actions at item level. This applies to the Edit and Delete buttons.

The properties are as follows:

  • VisibleEdit
  • VisibleDelete
  • EnableEdit
  • EnableDelete

All the properties are set to true by default.

If users are not allowed to edit uploaded files, all the Edit buttons should be set to invisible. The same applies to the Delete function.

Identical actions should be placed directly beneath one another.

Do not leave buttons enabled, only to show an error message informing the user that the function is not available.

Identical actions should always appear beneath one another.

Do
Show identical actions beneath each other
Show identical actions beneath each other

If users are not allowed to use a certain function, these buttons should not be shown at all.

Do
Hide functions if the user doesn't have authorization
Hide functions if the user doesn't have authorization

If certain actions are unavailable in some cases, such as for files from other users, we recommended that you disable these actions.

Do
Disable functions not available for a specific file
Disable functions not available for a specific file

Identical actions should be placed directly beneath one another. In the example opposite, the Delete buttons on the lower two items should be visible but disabled.

Don't
Do not position the same actions differently
Do not position the same actions differently

Do not disable all actions. If users are not allowed to use a certain action, these buttons should not be shown at all.

Don't
Don't disable all actions
Don't disable all actions
Information
If you want users to be able to upload only specific file types, we recommend doing this via mime types.
You should also inform users on the UI about the file types they are allowed to upload.

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation