on 04-10-2016 7:36 AM
Hello Experts,
The default behavior of the SAP FileUploader control is two buttons for uploading file: Browse & Upload.
Is it possible to use only the Browse button and upload the file when the user selects a file from the OS file dialog (like Gmail for example)?
Regards,
Omri
Hi Omri,
yes it is!
Just implement the "change" event and trigger the upload function in it:
onChange: function(oEvent){
var oUploader = oEvent.getSource();
oUploader.addHeaderParameter(new sap.ui.unified.FileUploaderParameter({name: "x-csrf-token",
value:oModel.getSecurityToken()
}))
oUploader.upload();
},
If you get an "403 - Forbidden"-Error just set the Property "sendXHR" of the FileUploader to true.
Regards,
Sascha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.