cancel
Showing results for 
Search instead for 
Did you mean: 

How to refer BTP Destination for Upload/Downlaod Files in SAP Build Apps

AnjalyGeorge
Explorer

Hi All,

Is there any way to refer the BTP Destination for Upload/Download URL in Flow functions Upload Files and Download Files.

Thanks,

Anjaly

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

anjaly.george Were you able to get it to work?

AnjalyGeorge
Explorer
0 Kudos

daniel.wroblewski I was able to manage it. I added the Upload/Download Url and passed the Bearer Token in header and in order to fix the CORS issue followed the blog https://blogs.sap.com/2021/03/22/6.-managing-back-end-calls/ and did changes for CAP service. Thanks for the help.

Accepted Solutions (0)

Answers (1)

Answers (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

No, I do not think you can do that.

But what are you trying to do? Retrieve a file that requires some sort of authentication that is passed in via destination?

AnjalyGeorge
Explorer
0 Kudos

daniel.wroblewski Yes. I need to pass the Bearer token for authentication to the Service to retrieve the file. If I can use destination it would have been easy to consume it.

Thanks,

Anjaly

AnjalyGeorge
Explorer
0 Kudos

daniel.wroblewski I tried hardcoding the url directly and passing the Bearer token in headers. But I am getting the CORS Policy error. I am using a CAP service. Can you please suggest any solution for this issue.

Thanks,

Anjaly

MarcHuber
Product and Topic Expert
Product and Topic Expert

I am also not sure if this is really working. But what you could try is to get the CSRF Token with a HTTP request before. Additionally, pass the X-CSRF-TOKEN ~ FETCH in the header. Store the CSRF token in a variable. Then, use the CSRF token to pass it during the call of your CAP service.

You can find some more details here: https://groups.community.sap.com/t5/sap-builders-discussions/passing-http-header-to-create-record-fl...