cancel
Showing results for 
Search instead for 
Did you mean: 

How do I upload a document to BTP DMS from UI5 FileUploader?

subhm779
Explorer
0 Kudos

I want to upload a document to BTP DMS using UI5 FileUploader.

MustafaBensan
Active Contributor
0 Kudos

Hi Shubham,

Is there a reason why you are trying to use the standalone UI5 File Uploader instead of the Reuse UI for DMS which is embeddable in a Fiori/UI5 application? This may also resolve the CORS issue you are facing.

Regards,

Mustafa.

subhm779
Explorer
0 Kudos

Hi Mustafa,

My end goal is to not upload a file in DMS, it is to upload the file and trigger a workflow using that uploaded file object Id. User will see a form to fill the details along with File Upload (using UI5 FileUploader). Once user submits the form the file will be uploaded to DMS and we will use the file object Id to trigger the workflow.

MustafaBensan
Active Contributor
0 Kudos

Which APIs are you using to obtain the file object ID and ultimately upload the file to DMS?

subhm779
Explorer
0 Kudos

I am following this blog BTP_DMS_REST_API to perform any operation on DMS .

Accepted Solutions (0)

Answers (2)

Answers (2)

tobias_breyer
Contributor
0 Kudos

Hi Shubham,

when you face a CORS issue in a BTP setting, then it is often that you use the wrong hostname for the purpose respectively you are missing an intermediate component that makes all accesses non-cross-origin.

Here, it might be that you call the DMS API on one host, but your UI is loaded from another.

That is, check whether you call the DMS API via the same portal-like component. For example SAP Build Workzone or any other reverse proxying component, such as stand-alone approuter or managed app-router. They "hide" the multitude of services behind them by making them accessible through destinations which you effectively address through routes, i.e. parts/patterns of the URL. For the UI, it then looks like both UI and DMS call are on the same host and there is no CORS issue.

Regards,

Tobias

yogananda
Product and Topic Expert
Product and Topic Expert
0 Kudos

subhm779

Maybe this can help: https://github.com/pdominique/cap-media-node

subhm779
Explorer
0 Kudos

Hi Yogananda ,

I actually want it to upload it from UI5 not CAP, as i am using ajax call to upload the file but facing CORS issue, any idea on this?