cancel
Showing results for 
Search instead for 
Did you mean: 

UploadCollection in SCP Portal

0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

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");     
gregorw
Active Contributor

You should not use getModulePath as this method is deprecated quite some time.

Answers (1)

Answers (1)

gregorw
Active Contributor
0 Kudos

Please check the solution I've found for a similar issue: Calling Service using AJAX in Fiori Elements Extension doesn't work in Launchpad