Skip to Content

uploadComplete event of the sap.ui.unified.FileUploader is not fired

Hello,

I'm trying to upload file using sap.ui.unified.FileUploader and display to a user message that a file is uploaded successfully (or not). The problem is that uploadComplete event is not fired.

Control definition:

<unified:FileUploader width="300px" id="fileUploader" change="documentChanged" 
    uploadComplete="handleUploadComplete">

Function's definition:

handleUploadComplete:function(oEvent){
    console.log("oUploader complete oEvent----> ",oEvent);
    console.log("oUploader complete oEvent.params----> ",oEvent.getParameters());}

In my upload function (which runs on "Upload File" button press):

oUploader.setUploadUrl(sUrl);// url is defined before
oUploader.addHeaderParameter(new sap.ui.unified.FileUploaderParameter({
     name:"slug",
     value: encodeURIComponent(oUploader.getValue())}));
oUploader.addHeaderParameter(new sap.ui.unified.FileUploaderParameter({
     name:"x-csrf-token",
     value:this._sToken // defined before}));
oUploader.setSendXHR(true);
oUploader.upload();

The event is just not fired (I have a breakpoint inside the function, and it's not triggered, no console.log messages). The file is uploaded fine.

What do I miss? Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers