Skip to Content

How to call success and failure function for Fileupload to find status of upload

I have written this code to upload a file

var oFileUploader = sap.ui.getCore().byId("id_fileUploader");

var File_name = oFileUploader.getValue();

oFileUploader.destroyHeaderParameters(); oModel.refreshSecurityToken(); oFileUploader .addHeaderParameter(new sap.ui.unified.FileUploaderParameter( { name : "x-csrf-token", value : oModel.getSecurityToken() })); oFileUploader .addHeaderParameter(new sap.ui.unified.FileUploaderParameter( { name : "slug", value : File_name, })); oFileUploader.upload();

fnSuccess()

{

sap.m.MessageToast.show("Success");

}

fnFail()

{

sap.m.MessageToast.show("Fail");

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 09 at 01:29 PM

    Found the answer file upload has success and abort properties.

    Add comment
    10|10000 characters needed characters exceeded