Upload Set

sap.m.UploadSet

Intro

The upload set control allows users to upload single or multiple files from a device (desktop, tablet, or phone) to an SAP Fiori app.

Despite its name, the upload set is not limited to plain upload scenarios. Depending on the context or the access rights, some users may only be allowed to download the files uploaded by others. You can use the upload set control for both cases.

When to Use

Use the upload set control if:

  • You want to show a list of uploaded files that can be modified.
  • You want to allow users to add or remove several files, and to change the file names.
  • You are still using one of the older upload controls:
    • sap.ca.ui.FileUpload
    • sap.m.UploadCollection (deprecated since SAPUI5 version 1.88)

Do not use the upload set control if:

  • The user can upload only one file to the app. In this case, use the sap.ui.unified.FileUploader control instead.

Layout

Default Layout and Actions

Files are listed vertically. By default, each item has an Edit and a Remove button.

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

You can control the visibility and the active state for all actions at item level.

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.

You can also define your own statuses. These usually refer to the object state in a workflow (such as Approved or Overdue). Statuses can be shown in different colors in accordance with the visual guideline for semantic colors.

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

Layout – Attributes and statuses
Layout – Attributes and statuses

Technical Statuses

Unlike the statuses mentioned above, technical statuses are not bound to a workflow or business process. They are mainly used to show the current editing status of an object (Draft, Locked, Unsaved Changes). For further uses and more details, see Object Display Components and Draft Handling.

Layout – Technical statuses
Layout – Technical statuses

Behavior and Interaction

Uploading Files

The upload set offers two basic working modes:

  • Instant upload (default): Files are uploaded as soon as they are dropped onto the control or the OK button in the file selection dialog is clicked.
  • Manual upload: All added files are first collected in the front-end list, where the user needs to trigger the upload.
Developer Hint
Using the Boolean property instantUpload, you can determine whether files are uploaded immediately or whether the user needs to trigger the upload explicitly.

If some users are only allowed to download the files uploaded by others, you can disable the upload option.

Developer Hint
The Boolean property uploadEnabled controls whether or not users are able to upload files.

Unlike the deprecated Upload Collection control, the Upload Set control allows you to use a custom uploader.

Developer Hint
For an example of a custom uploader, see the SAPUI5 sample.

Empty State

If empty, the upload set provides a hint to use the Upload button or drag and drop to upload files. This hint already provides a large enough zone for users to drop their files.

Interaction - No files found
Interaction - No files found

Drag and Drop

Users can easily select one or multiple files from their computer and drag them onto the upload set to start the upload.

As soon as a user starts to drag a file over the application, the hint changes into a drop zone, indicating where to place the file.

Interaction - Drag and drop (1)
Interaction - Drag and drop (1)

As the user hovers over the drop zone, the color changes again to indicate that the file can be released.

The upload process itself is the same as if a file had been added via the Upload button.

Interaction - Drag and drop (2)
Interaction - Drag and drop (2)

Opening Files

Files are opened by clicking the file name of the attachment. How the files open depends on the operating system and browser settings.

On desktop devices, clicking the file name opens the program that has been assigned to this file type. In some cases, the files are opened directly in the browser if they are among the supported file types, like jpg, png or pdf. However, this also depends on the individual browser and its settings.

Mobile devices usually open a dialog in which the user can select an app that supports this file type.

Renaming Files

The Edit function works identically on desktop and mobile devices.

  1. The user clicks the Edit ) button.
  2. The file name becomes an input field in which the existing name is highlighted. The icon buttons Edit (  ) and Remove (  ) are replaced by two text buttons: Rename and Cancel.
  3. When the user starts typing, the highlighted text is overwritten. Alternatively, the user can use the mouse or keyboard to change the selected text.
  4. The new file name can be validated in two ways:
    • The user clicks Rename.
    • The user presses Enter.
Guidelines
Specify the file name in the dialog.

Removing Files

The Remove function works identically on desktop and mobile devices.

After clicking the Remove (  ) button for a file, the user is prompted to confirm the removal of the respective file.

Remove 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.

Clickable Attributes

Object attributes can be made clickable. This can be very helpful to provide users with a direct way to access certain information, such as a person’s profile and contact data, or the version history of a file.

Examples:

  • Uploaded By: John Miller
  • Last Edited By: Donna Moore
  • Version 1.1
Guidelines

  • Use a quick view to show this additional information.
  • Don’t use more than two or three linked attributes per item. Excessive use of clickable attributes overloads the UI with interactive elements and has a negative impact on usability.

Responsiveness

The upload set control offers full responsive behavior from small phones to large desktop screens. Uploading, downloading, renaming, and deleting works on all screen sizes. Texts that no longer fit into the available space are truncated.

Size S
Size S
Size M
Size M
Size L
Size L

Example

You can use the upload set control in different contexts, whenever users need to be able to upload multiple files. The example below shows the object page of a product, in this case a machine, with an Attachments tab containing several documents about its documents for assembly, service, and warranty.

Upload set in object page
Upload set in object page

Other possible scenarios:

  • Warranty claim: Users need to upload images of a damaged item.
  • Product details: Editors can upload product pictures that will be shown in the online shop.
  • Service history: Whenever maintenance measures are performed, the service worker attaches a document to the object.

Top Tips

When to Show, Disable, and Hide Actions

The Edit and Remove buttons are visible and enabled by default. If you don’t want to allow users to edit or remove uploaded files, hide the corresponding buttons.

Don’t leave buttons enabled and then show an error message when the function isn’t available.

Do
Vertically align all actions
Vertically align all actions
Don't
Don't position buttons differently. Place identical actions directly underneath one another.
Don't position buttons differently. Place identical actions directly underneath one another.
Do
If users aren't allowed to use a certain function, hide the corresponding button.
If users aren't allowed to use a certain function, hide the corresponding button.
Don't
Don't disable all actions. If users aren't allowed to use a certain action, don't show the corresponding button.
Don't disable all actions. If users aren't allowed to use a certain action, don't show the corresponding button.
Do
If an action is unavailable, disable it (for example, if a file was uploaded by another user).
If an action is unavailable, disable it (for example, if a file was uploaded by another user).

Custom Uploader

Developer Hint
Unlike the deprecated Upload Collection control, the Upload Set control allows you to implement a custom uploader.

Related Links

Elements and Controls

Implementation