Skip to Content
0
Aug 03, 2016 at 06:54 AM

Reg : File uploading query

93 Views

Hi everyone,

I am trying to upload file in back end from Gateway client it's uploading. Please till me front end code to call this.

My front end code is follow it's showing bad Request (I am added proxy in web.xml)

fnUpload : function()

{

oController = this;

oModel = sap.ui.getCore().getModel();

var token = oModel.getSecurityToken();

var oFileUploader = this.getView().byId("fileUploader");

var file = oFileUploader.getValue();

var url = "proxy/sap/opu/odata/sap/ZGW_DP_INV_SRV/Secondary_SalesSet(Kunnr='2200')/$value";

oFileUploader.addHeaderParameter(new sap.ui.unified.FileUploaderParameter({

name: "slug",

value: oFileUploader.getValue()

}));

oFileUploader.addHeaderParameter(new sap.ui.unified.FileUploaderParameter({

name: "x-csrf-token",

value: token

}));

var oHeaders = oFileUploader.setSendXHR(true);

oFileUploader.setUploadUrl(url);

oFileUploader.upload();

},

My Gateway client is follow :

Attachments

upload.png (191.0 kB)