Showing results for 
Search instead for 
Did you mean: 

Using UploadCollection control in Hybrid app for iOS

0 Kudos


I have created a Hybrid UI5 application using HAT, i am using UploadCollection control in one of the screen, the control works fine on a Browser (Desktop and Phone) but does not work when wrapped in Kapsel and Cordova. When i click on the 'Add' button it does nothing, no error on console.

Note: I have added the required Privacy Keys in my Info.plist

Is there something else i need to configure to open the Photo Library or the Camera from UploadCollection control?

this is my UploadCollection code

new sap.m.UploadCollection("UploadCollection", {
					multiple: true,
					uploadUrl: that.getView().getModel("mainServiceModel").sServiceUrl + "/AttachmentsSet",
					numberOfAttachmentsText: "Attachments (0)",
					terminationEnabled: false,
					fileType: ["jpg", "txt", "ppt", "docx", "xls", "pdf", "png"],
					mimeType: ["image/jpg", "image/jpeg", "application/pdf"],
					noDataText: "No Data",
					beforeUploadStarts: function(e) {;
						// Header Slug
						var oCustomerHeaderSlug = new sap.m.UploadCollectionParameter({
							name: "slug",
							value: workorderId + "/" + lineItem + "/" + e.getParameter("fileName") + "/Description"
						if (sap.hybrid === null) {
							var oCustomerHeaderHybrid = new sap.m.UploadCollectionParameter({
								name: "X-SUP-APPCID",
								value: sap.hybrid.SMP.AppContext.applicationConnectionId

					uploadComplete: function(e) {"Upload Completed");
						this.bindAggregation("items", {
							path: "mainServiceModel>/AttachmentsSet",
							filters: [new sap.ui.model.Filter("ObjectId", sap.ui.model.FilterOperator.EQ, workorderId),
								new sap.ui.model.Filter("Item", sap.ui.model.FilterOperator.EQ, lineItem)
							template: new sap.m.UploadCollectionItem({
								enableEdit: true,
								enableDelete: true,
								visibleEdit: true,
								visibleDelete: true,
								fileName: "{mainServiceModel>Filename}",
								url: "{mainServiceModel>AbsoluteUrl}",
								mimeType: "{mainServiceModel>ContentType}"
						var aItems = sap.ui.getCore().byId("UploadCollection").getItems();
						sap.ui.getCore().byId("UploadCollection").setNumberOfAttachmentsText("Attachments (" + aItems.length + ")");
					change: function(e) {
						var oUploadCollection = e.getSource();
						// Header Token
						var oCustomerHeaderToken = new sap.m.UploadCollectionParameter({
							name: "x-csrf-token",
							value: secToken

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Naveen,

have you activated and plugged in the cordova-plugin for camera, access file and capture?

If you don't integrated the plugins into your UI5-app it doesn't work...