SAPUI5 FileUploader: Cannot find and append file to FormData()

时间:2015-06-30 14:00:27

标签: javascript file-upload sapui5 form-data

How do I access the file that I select with my fileuploader?

Any solutions are welcome.

var oInput = new sap.m.Input();  
var oFileUploader = new sap.ui.unified.FileUploader();

var oButton = new sap.m.Button({
text: "Send data",
press: function(){

    var oFormData = new FormData();

    oFormData.append("myTitle", oInput.getValue());
    oFormData.append("myFile", ****This is where I want to insert my file****);

    var xhr = new XMLHttpRequest;
      xhr.open('POST', 'www.myUrl.com/foo/bar', true);
      xhr.send(oFormData);

}
});

1 个答案:

答案 0 :(得分:1)

自己找到答案:

guess >= 7 || guess <= 0