Skip to Content
Aug 08, 2019 at 12:32 PM

Error in getHeader for getModel for UploadCollection

68 Views Last edit Aug 08, 2019 at 03:13 PM 2 rev

I am trying to use UploadCollect and store the file to Gateway. During Before File Upload getHeaders() method fails.

Cannot read property 'getHeaders' of undefined. XML View attached

onBeforeUploadFile: function(e) {
                            var t = this.getXsrfToken();
                            var c = new sap.m.UploadCollectionParameter({
                                name: "x-csrf-token",
                                value: t

 getXsrfToken: function() {
                      var t = this.getView().getModel().getHeaders()['x-csrf-token'];

XML View