on 04-25-2021 7:30 AM
Hi, experts.
We have a problem about UploadCollection. The UploadCollection did not add the application-specified prefix to the uploadUrl when the application runs in the SCP CF Portal. And the url did not redirected by the route configured in the 'xs-app.json'.
route in the xs-app.json : 'WF'
{
"welcomeFile": "/index.html",
"authenticationMethod": "route",
"logout": {
"logoutEndpoint": "/do/logout"
},
"routes": [{
"source": "^/bpmworkflowruntime/(.*)$",
"target": "/$1",
"service": "com.sap.bpm.workflow",
"endpoint": "workflow_rest_url",
"authenticationType": "xsuaa"
}, {
"source": "^/S4/(.*)$",
"target": "$1",
"authenticationType": "none",
"destination": "S4",
"csrfProtection": false
}, {
"source": "^/WF/(.*)$",
"target": "$1",
"authenticationType": "none",
"destination": "WFLOG",
"csrfProtection": false
}, {
"source": "^(.*)$",
"target": "$1",
"service": "html5-apps-repo-rt",
"authenticationType": "xsuaa",
"cacheControl": "no-cache, no-store, must-revalidate"
}]
}
"uploadUrl" setting in the UploadCollection :
uploadUrl="/WF/v2/wf/Attachment"
But it shows '403' error when uploading files.
solution found :
use control 'UploadSet' instead and use function 'setUploadUrl' in the runtime.
①the UploadCollection does not support change uploadurl in the runtime if property 'instantUpload' is set to 'false'.
②Besides , the 'UploadCollection' control handles the upload url in a pretty wired way. ( "./xxxxx" will be handled with "/xxxxxxx" ).
code of change upload url in the runtime:
this.byId("UploadSetAttach").setUploadUrl(jQuery.sap.getModulePath("MM.purchaseapprovalplat") + "/WF/v2/wf/Attachment");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should not use getModulePath as this method is deprecated quite some time.
Please check the solution I've found for a similar issue: Calling Service using AJAX in Fiori Elements Extension doesn't work in Launchpad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
10 | |
8 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.