Show TOC

Upload CollectionLocate this document in the navigation structure

Upload Collection is a list control for attachment management that provides the ability to upload, edit or delete attachments.

The UploadCollection control allows users to upload single or multiple files from their devices (desktop PC, tablet or phone) to an app. Due to its responsiveness, the upload collection can be used in containers of different sizes .

Overview

You can use the UploadCollection control to show a list of files, for example, attachments or uploads, that can be modified, or you can allow users to add or remove files to or from this list. The following features are available:

  • Upload files

    The upload is triggered by the Add pushbutton (plus icon). Afterwards the OS-native file picker dialog appears and you can select one or multiple files. However, the consuming application need to enable the upload of multiple files by using the multiple property during the instantiation. During the upload process, a progress indicator provides information about the status.

  • Open files

    To open a listed file, you can choose the icon or thumbnail of the attachment as well as the filename itself. Depending on the file extension, browser capabilities, and device type (PC or mobile), the file is handled differently, for example, it is opened in a new tab or downloaded, if no display capability is available in the browser.

  • Rename files

    Choosing on the Rename pushbutton (pen icon) turns the file name into an input field and allows modification. You can confirm the renaming by choosing the OK or cancel by choosing Cancel. If the sameFilenameAllowed property is set to true, the new file name is validated and, if the file name already exists in the current list, an error occurs, which indicates that you need to change the file name.

  • Delete files

    You can delete files by using the Delete pushbutton (x icon with a circle). After choosing the Delete pushbutton, a dialog appears, asking the user to confirm the deletion of the respective file that removes the file from the list.

Layout

For an overview of how the uploaded files are listed, see the UploadCollection control on the Explored tab in the Demo Kit.

The two pushbuttons Rename and Delete that are displayed for each item are active and visible by default. However, both icons can be set to invisible or inactive. For more information, see the UploadCollection control on the API Reference tab in the Demo Kit.

While most file types have generic icons (such as Word documents, Excel sheets, PDFs, and so on), graphic files can be displayed with a small thumbnail preview of its graphic if the respective URL is provided.

Constraints and Dependencies

By using the UploadCollection control, you need to be aware of the following constraints:

  • The UploadCollection control does not work with IE9 because of a missing header parameter handling needed for the upload.

  • The file name of an upload item can contain any text and special characters but not a URL.

The sap.m.UploadCollection control uses the sap.ui.unified.FileUploader control and contains dependencies to this control. If you want to use the UploadCollection control, you need to be aware of these dependencies. For more information, see the FileUploader control on the API Reference tab in the Demo Kit.