Access-Control-Allow-Origin

Highlighted
New Contributor

Access-Control-Allow-Origin

Hello Sir

 

Greetings of The Day

 

I wish to bring it your kind notice that Currently i am Integrating Salesforce to Box.com and I am facing a Issue regarding uploading a file .

 

Following Error I got:

 

"Access to XMLHttpRequest at 'https://upload.box.com/api/2.0/files/content?parent_id=0' from origin 'https://c.ap15.visual.force.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."

 

Let me Know if You have any further queries on the same ,awaiting your response.

 

Thanks and Regards

Sanjay Kumar Prajapat

 

 

3 REPLIES 3
Highlighted
Box Employee

Re: Access-Control-Allow-Origin

@sanjayPrajapat please have a look at this page: 

 

https://developer.box.com/guides/best-practices/cors/

 

You will need to enable CORS for the domain you're working on.


---
Developer Advocate @ Box
Highlighted
New Contributor

Re: Access-Control-Allow-Origin

Sir

 

I have already did it,still i have got error

Highlighted
Box Employee

Re: Access-Control-Allow-Origin

Ok great!

 

If you are using the standard Box for Salesforce managed package integration, then you may need to add the domain(s) to Salesforce’s Remote Site Settings:
https://help.salesforce.com/articleView?id=configuring_remoteproxy.htm

 

For Communities and Lightning components in general, you need to add the domain(s) to CSP Trusted Sites:
https://help.salesforce.com/articleView?id=csp_trusted_sites.htm 


---
Developer Advocate @ Box