cancel
Showing results for 
Search instead for 
Did you mean: 

Upload picture to document information extraction via Custom JavaScript in build apps-CORS ERROR

SushamaS
Associate
Associate
0 Kudos
682

I'm tying to build an app in SAP Build apps to capture picture of invoice and upload it to document information extraction.

To upload image to document information extraction I used custom JavaScript and its throwing the following CORS error:

Do we have a fix for this or any other way to upload image to document information extraction?

Accepted Solutions (0)

Answers (2)

Answers (2)

zeise
Product and Topic Expert
Product and Topic Expert

Hi Sushama,

the error that you observe is a security measure enforced by your browser based on information retrieved from the server that you use to deliver the web page and the script. There are two ways to mitigate this:


You can find more information on CORS here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

You might also consider calling the DOX service from the back-end rather than from the front-end.

Best regards,
Manuel

Yogananda
Product and Topic Expert
Product and Topic Expert
0 Kudos
sushamas

you can install cors lib , so you will not have any issues after that in SAP Build APps

npm i cors
PTLee
Explorer
0 Kudos

Hi yogananda,
Could you please expand more about how to 'npm i cors' in SAP Build App?
I have the same scenario and same issue as sushamas. Thank you!